Skip to content
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

mounted routes with non-word characters #35975

Merged
merged 1 commit into from Apr 15, 2019
Merged

Conversation

xithan
Copy link
Contributor

@xithan xithan commented Apr 15, 2019

Summary

Fixes #35786, a regression introduced by ccc0597.

There are two special cases for which routing is broken:

  1. If an engine is mounted to / then paths that start with a non-word character don't work (eg. /~foo).
  2. If an engine is mounted to a path that ends with a non-word character (eg /engine*) then all routes to the engine don't work.

The underlying problem is that in those cases routes to the engine don't have a word boundary after the part where the engine is mounted (between / and ~ in /~foo and between * and / in /engine*/foo).
#1 is handled by a conditional. #2 is solved with an additional lookahead check for/ in the regex.

@rails-bot rails-bot bot added the actionpack label Apr 15, 2019
@rafaelfranca rafaelfranca merged commit 60afbff into rails:master Apr 15, 2019
rafaelfranca added a commit that referenced this pull request Apr 15, 2019
mounted routes with non-word characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URLs with special characters like * : ~ break routing
2 participants