1
0
Fork 0
mirror of https://github.com/sinatra/sinatra synced 2023-03-27 23:18:01 -04:00

Do not add a / to empty path in 'path_traversal'

This commit is contained in:
Mael Clerambault 2012-05-27 23:17:39 +02:00
parent d823177af6
commit 623aed38b5

View file

@ -12,7 +12,7 @@ module Rack
class PathTraversal < Base
def call(env)
path_was = env["PATH_INFO"]
env["PATH_INFO"] = cleanup path_was if path_was
env["PATH_INFO"] = cleanup path_was if path_was && !path_was.empty?
app.call env
ensure
env["PATH_INFO"] = path_was