aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/journey
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-04-15 18:12:57 -0400
committerGitHub <noreply@github.com>2019-04-15 18:12:57 -0400
commit60afbfffdcdb4510deccf8d6db303dd4260e3dc7 (patch)
tree52f935d8d5dcdece3b8eda0e49448fcfc9868831 /actionpack/lib/action_dispatch/journey
parentfbb8b68403ff8663a561b20746e9da7719eeb83e (diff)
parent64ed91f5aad74cdfa93dc08c2f5899a8e0555f4c (diff)
downloadrails-60afbfffdcdb4510deccf8d6db303dd4260e3dc7.tar.gz
rails-60afbfffdcdb4510deccf8d6db303dd4260e3dc7.tar.bz2
rails-60afbfffdcdb4510deccf8d6db303dd4260e3dc7.zip
Merge pull request #35975 from xithan/master
mounted routes with non-word characters
Diffstat (limited to 'actionpack/lib/action_dispatch/journey')
-rw-r--r--actionpack/lib/action_dispatch/journey/path/pattern.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb
index a968df5f19..dee2980eb1 100644
--- a/actionpack/lib/action_dispatch/journey/path/pattern.rb
+++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -119,7 +119,8 @@ module ActionDispatch
class UnanchoredRegexp < AnchoredRegexp # :nodoc:
def accept(node)
- %r{\A#{visit node}(?:\b|\Z)}
+ path = visit node
+ path == "/" ? %r{\A/} : %r{\A#{path}(?:\b|\Z|/)}
end
end