diff options
author | Andrew White <pixeltrix@users.noreply.github.com> | 2014-10-14 20:06:36 +0100 |
---|---|---|
committer | Andrew White <pixeltrix@users.noreply.github.com> | 2014-10-14 20:06:36 +0100 |
commit | 6bb040b55748269dd2cb2ae3a36fa54ca7c70c5e (patch) | |
tree | aeee85e344150e9faeb9be2e6f33447c22f0b6ea /actionpack/lib/action_dispatch/journey | |
parent | 5a5073301c66b7999ad25c18a22d44922002c689 (diff) | |
parent | 3041bb2a942711d7e4919795c9aff0d5d568568b (diff) | |
download | rails-6bb040b55748269dd2cb2ae3a36fa54ca7c70c5e.tar.gz rails-6bb040b55748269dd2cb2ae3a36fa54ca7c70c5e.tar.bz2 rails-6bb040b55748269dd2cb2ae3a36fa54ca7c70c5e.zip |
Merge pull request #17220 from Bounga/fix_journey_rfc_3986_compliance
Improve Journey compliance to RFC 3986
Diffstat (limited to 'actionpack/lib/action_dispatch/journey')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/scanner.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/journey/scanner.rb b/actionpack/lib/action_dispatch/journey/scanner.rb index 633be11a2d..ad1cd0f5e8 100644 --- a/actionpack/lib/action_dispatch/journey/scanner.rb +++ b/actionpack/lib/action_dispatch/journey/scanner.rb @@ -39,18 +39,18 @@ module ActionDispatch [:SLASH, text] when text = @ss.scan(/\*\w+/) [:STAR, text] - when text = @ss.scan(/\(/) + when text = @ss.scan(/(?<!\\)\(/) [:LPAREN, text] - when text = @ss.scan(/\)/) + when text = @ss.scan(/(?<!\\)\)/) [:RPAREN, text] when text = @ss.scan(/\|/) [:OR, text] when text = @ss.scan(/\./) [:DOT, text] - when text = @ss.scan(/:\w+/) + when text = @ss.scan(/(?<!\\):\w+/) [:SYMBOL, text] - when text = @ss.scan(/[\w%\-~]+/) - [:LITERAL, text] + when text = @ss.scan(/(?:[\w%\-~!$&'*+,;=@]|\\:|\\\(|\\\))+/) + [:LITERAL, text.gsub('\\', '')] # any char when text = @ss.scan(/./) [:LITERAL, text] |