Skip to content
This repository has been archived by the owner on May 16, 2021. It is now read-only.

Commit

Permalink
Do not add a / to empty path in 'path_traversal'
Browse files Browse the repository at this point in the history
  • Loading branch information
hanklords committed May 27, 2012
1 parent 1845aa3 commit c9c75e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/protection/path_traversal.rb
Expand Up @@ -12,7 +12,7 @@ module Protection
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
Expand Down

0 comments on commit c9c75e8

Please sign in to comment.