From 64ed91f5aad74cdfa93dc08c2f5899a8e0555f4c Mon Sep 17 00:00:00 2001 From: xithan Date: Mon, 15 Apr 2019 13:21:02 +0200 Subject: mounted routes with non-word characters --- actionpack/lib/action_dispatch/journey/path/pattern.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/journey') diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb index 697f5b9d8b..25ecb37dc8 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 -- cgit v1.2.3