mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
Drop Ruby 1.8 compat code
This commit is contained in:
parent
5e2e41f283
commit
1115703b7c
1 changed files with 4 additions and 12 deletions
|
@ -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
|
||||
encoding = path.encoding
|
||||
dot = '.'.encode(encoding)
|
||||
slash = '/'.encode(encoding)
|
||||
backslash = '\\'.encode(encoding)
|
||||
|
||||
parts = []
|
||||
unescaped = path.gsub(/%2e/i, dot).gsub(/%2f/i, slash).gsub(/%5c/i, backslash)
|
||||
|
|
Loading…
Add table
Reference in a new issue