We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2dd0bd9 commit 2265ea3Copy full SHA for 2265ea3
lib/grape/router.rb
@@ -12,10 +12,11 @@ class Router
12
# normalize_path("/%ab") # => "/%AB"
13
# https://github.com/rails/rails/blob/00cc4ff0259c0185fe08baadaa40e63ea2534f6e/actionpack/lib/action_dispatch/journey/router/utils.rb#L19
14
def self.normalize_path(path)
15
- return +'/' unless path
+ return '/' unless path
16
+ return path if path == '/'
17
18
# Fast path for the overwhelming majority of paths that don't need to be normalized
- return path.dup if path == '/' || (path.start_with?('/') && !(path.end_with?('/') || path.match?(%r{%|//})))
19
+ return path.dup if path.start_with?('/') && !(path.end_with?('/') || path.match?(%r{%|//}))
20
21
# Slow path
22
encoding = path.encoding
0 commit comments