Drop Ruby 1.8 compat code
This commit is contained in:
parent
5e2e41f283
commit
1115703b7c
|
@ -19,18 +19,10 @@ module Rack
|
|||
end
|
||||
|
||||
def cleanup(path)
|
||||
if path.respond_to?(:encoding)
|
||||
# Ruby 1.9+ M17N
|
||||
encoding = path.encoding
|
||||
dot = '.'.encode(encoding)
|
||||
slash = '/'.encode(encoding)
|
||||
backslash = '\\'.encode(encoding)
|
||||
else
|
||||
# Ruby 1.8
|
||||
dot = '.'
|
||||
slash = '/'
|
||||
backslash = '\\'
|
||||
end
|
||||
|
||||
parts = []
|
||||
unescaped = path.gsub(/%2e/i, dot).gsub(/%2f/i, slash).gsub(/%5c/i, backslash)
|
||||
|
|
Loading…
Reference in New Issue