-
Notifications
You must be signed in to change notification settings - Fork 4
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
Wrong handling of paths without params #11
Wrong handling of paths without params #11
Comments
Hi, could you post an example of a rewrite rule I can use to reproduce this bug please? |
Let's consider the following rules:
Here with the first rule, I'd like to rewrite every path starting with /login/ to my dist folder path. This rule alone works, but as soon as I add the second one, everything will be redirected to 'dist/login/index.html'. The second rule doesn't have params to be replaced. getTargetUrl() will return the unmodified 'toUrl' which has been set to 'to' at the beginning of the function. (This 'to' variable holds 'dist/login/index.html'.) |
Fixed and released in lws-rewrite v3.1.1 - please upgrade. Thanks, let me know if you find any more issues! |
Thank you very much, that was really quick. :) |
Rewrite rules having no parameters, automatically applied to every path (even to the non-matching ones.)
The problem is in getTargetUrl function of util.js.
The toUrl is automatically set to the to parameter, and will be returned even if the path doesn't match. For non-matching paths the intact url parameter should be returned instead.
The text was updated successfully, but these errors were encountered: