From 3041bb2a942711d7e4919795c9aff0d5d568568b Mon Sep 17 00:00:00 2001 From: Nicolas Cavigneaux Date: Thu, 9 Oct 2014 15:06:26 +0200 Subject: Improve Journey compliance to RFC 3986 The scanner in Journey fails to recognize routes that use literals from the sub-delims section of RFC 3986. This commit enhance the compatibility of Journey with the RFC by adding support of authorized delimiters to the scanner. Fix #17212 --- actionpack/CHANGELOG.md | 10 +++++++++ actionpack/lib/action_dispatch/journey/scanner.rb | 10 ++++----- .../test/journey/route/definition/scanner_test.rb | 25 ++++++++++++++++------ 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/actionpack/CHANGELOG.md b/actionpack/CHANGELOG.md index de9722c392..64105934cd 100644 --- a/actionpack/CHANGELOG.md +++ b/actionpack/CHANGELOG.md @@ -1,3 +1,13 @@ +* Improve Journey compliance to RFC 3986 + + The scanner in Journey failed to recognize routes that use literals + from the sub-delims section of RFC 3986. It's now able to parse those + authorized delimiters and route as expected. + + Fixes #17212 + + *Nicolas Cavigneaux* + * Deprecate implicit Array conversion for Response objects. It was added (using `#to_ary`) so we could conveniently use implicit splatting: 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(/(?