mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Merge pull request #12966 from ToyboxZach/patch-2
[ Meteor v3 ] - Revert localhost change
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
[](https://meteor.com)
|
||||
[](https://guide.meteor.com/3.0-migration)
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -43,10 +43,10 @@ Meteor.absoluteUrl = function (path, options) {
|
||||
!/http:\/\/127\.0\.0\.1[:\/]/.test(url)) // or 127.0.0.1
|
||||
url = url.replace(/^http:/, 'https:');
|
||||
|
||||
var localhostRegex = /^http:\/\/localhost([:\/].*)/;
|
||||
if (localhostRegex.test(url) || options.replaceLocalhost)
|
||||
url = url.replace(localhostRegex, 'http://127.0.0.1$1');
|
||||
|
||||
if (options.replaceLocalhost)
|
||||
{
|
||||
url = url.replace( /^http:\/\/localhost([:\/].*)/, 'http://127.0.0.1$1');
|
||||
}
|
||||
return url;
|
||||
};
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ Tinytest.add("absolute-url - basics", function(test) {
|
||||
rootUrl: prefix + "localhost",
|
||||
secure: true,
|
||||
}),
|
||||
"http://127.0.0.1/foo"
|
||||
"http://localhost/foo"
|
||||
);
|
||||
test.equal(
|
||||
Meteor.absoluteUrl("foo", {
|
||||
rootUrl: prefix + "localhost:3000",
|
||||
secure: true,
|
||||
}),
|
||||
"http://127.0.0.1:3000/foo"
|
||||
"http://localhost:3000/foo"
|
||||
);
|
||||
test.equal(
|
||||
Meteor.absoluteUrl("foo", {
|
||||
|
||||
Reference in New Issue
Block a user