aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorPetri Avikainen <petri.avikainen@gmail.com>2019-02-05 14:13:38 +0200
committerPetri Avikainen <petri.avikainen@gmail.com>2019-02-05 14:13:38 +0200
commit1315582b374f33becfb325bf339674a0a5e6d141 (patch)
tree49377c5ca63785760544e6d52c5e85cdf32e07e5 /actionpack/lib/action_dispatch
parentc94754e2f0bc488907157382ece309baf4ddb1b0 (diff)
downloadrails-1315582b374f33becfb325bf339674a0a5e6d141.tar.gz
rails-1315582b374f33becfb325bf339674a0a5e6d141.tar.bz2
rails-1315582b374f33becfb325bf339674a0a5e6d141.zip
Restrict matching with word boundary or end of string
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/journey/path/pattern.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/path/pattern.rb b/actionpack/lib/action_dispatch/journey/path/pattern.rb
index 6924dc92c2..697f5b9d8b 100644
--- a/actionpack/lib/action_dispatch/journey/path/pattern.rb
+++ b/actionpack/lib/action_dispatch/journey/path/pattern.rb
@@ -119,7 +119,7 @@ module ActionDispatch
class UnanchoredRegexp < AnchoredRegexp # :nodoc:
def accept(node)
- %r{\A#{visit node}\b}
+ %r{\A#{visit node}(?:\b|\Z)}
end
end