mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Don’t be all weird if ROOT_URL ends with /
Previously, ROOT_URLs of `http://foo.com`, `http://foo.com/`, and `http://foo.com/bar` worked fine, but `http://foo.com/bar/` did not work because of the trailing slash. We could throw an error, but why not just trim it off.
This commit is contained in:
@@ -8,7 +8,11 @@ if (process.env.ROOT_URL &&
|
||||
throw Error("$ROOT_URL, if specified, must be an URL");
|
||||
}
|
||||
var pathPrefix = parsedUrl.pathname;
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX = pathPrefix === "/" ? "" : pathPrefix;
|
||||
if (pathPrefix.slice(-1) === '/') {
|
||||
// remove trailing slash (or turn "/" into "")
|
||||
pathPrefix = pathPrefix.slice(0, -1);
|
||||
}
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX = pathPrefix;
|
||||
} else {
|
||||
__meteor_runtime_config__.ROOT_URL_PATH_PREFIX = "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user