mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Switch regex for delete_suffix in normalize_path
This commit is contained in:
parent
bcfa51fba6
commit
4fb78a0b87
1 changed files with 6 additions and 4 deletions
|
@ -19,11 +19,13 @@ module ActionDispatch
|
|||
encoding = path.encoding
|
||||
path = +"/#{path}"
|
||||
path.squeeze!("/")
|
||||
path.sub!(%r{/+\Z}, "")
|
||||
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
|
||||
path = +"/" if path == ""
|
||||
|
||||
unless path == "/"
|
||||
path.delete_suffix!("/")
|
||||
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
|
||||
end
|
||||
|
||||
path.force_encoding(encoding)
|
||||
path
|
||||
end
|
||||
|
||||
# URI path and fragment escaping
|
||||
|
|
Loading…
Reference in a new issue