aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorGannon McGibbon <gannon.mcgibbon@gmail.com>2018-09-27 11:00:44 -0400
committerGannon McGibbon <gannon.mcgibbon@gmail.com>2018-09-27 13:12:22 -0400
commit7670d60977a7de3d11a8a9004b8a7a1c60383ee7 (patch)
treeba036e61a8f16838fef075cc2e46dbe5e16cadd2 /actionpack/lib/action_dispatch/routing/mapper.rb
parent8e123847e8ba0a59aafa708950a4887a669311b4 (diff)
downloadrails-7670d60977a7de3d11a8a9004b8a7a1c60383ee7.tar.gz
rails-7670d60977a7de3d11a8a9004b8a7a1c60383ee7.tar.bz2
rails-7670d60977a7de3d11a8a9004b8a7a1c60383ee7.zip
Fix optionally scoped root route unscoped access
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index b618b9c400..9b378d9031 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -390,7 +390,7 @@ module ActionDispatch
# for root cases, where the latter is the correct one.
def self.normalize_path(path)
path = Journey::Router::Utils.normalize_path(path)
- path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^)]+\)$}
+ path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/(\(+[^)]+\)){1,}$}
path
end