-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting ROOT_URL with a path causes FlowRouter.url() to report incorrect url #684
Comments
Possibly related to 89fc983 |
|
I'm having a similar issue - I went through and added some logging to the FlowRouter.url() function and found this output: var completePath = this.path.apply(this, arguments);
// /wekan/b
var basePath = this._basePath || '/';
// /wekan
var pathWithoutBase = completePath.replace(new RegExp('^' + basePath), '');
// /b
return Meteor.absoluteUrl(pathWithoutBase);
// https://mydomain.net/wekan//b The router should definitely be taking out the leading slash. Changing line 7 of lib/router.js to var pathWithoutBase = completePath.replace(new RegExp('^(\/)|' + basePath), ''); An argument could be added for keeping that leading slash if necessary (ie. using a hashbang). |
|
@sunhaolin Ah, yes. Good catch, thank you. This should fix it and account for the slash immediately following the base path if it exists. var pathWithoutBase = completePath.replace(new RegExp('^' + basePath + '(\/)'), ''); |
If the ROOT_URL environment variable is set to contain a path (e.g.
http://localhost:3000/app
),FlowRouter.url()
inserts an extra forward slash in the return value.Repro: https://github.com/carlevans719/flow-router-root-url-repro
The text was updated successfully, but these errors were encountered: