deal with PATH_INFO being nil, fixes #7
This commit is contained in:
parent
6f1ae47820
commit
4491e2676d
|
@ -12,7 +12,7 @@ module Rack
|
|||
class PathTraversal < Base
|
||||
def call(env)
|
||||
path_was = env["PATH_INFO"]
|
||||
env["PATH_INFO"] = cleanup path_was
|
||||
env["PATH_INFO"] = cleanup path_was if path_was
|
||||
app.call env
|
||||
ensure
|
||||
env["PATH_INFO"] = path_was
|
||||
|
|
|
@ -4,7 +4,7 @@ module Rack
|
|||
VERSION
|
||||
end
|
||||
|
||||
SIGNATURE = [1, 1, 2]
|
||||
SIGNATURE = [1, 1, 4]
|
||||
VERSION = SIGNATURE.join('.')
|
||||
|
||||
VERSION.extend Comparable
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Gem::Specification.new do |s|
|
||||
# general infos
|
||||
s.name = "rack-protection"
|
||||
s.version = "1.1.2"
|
||||
s.version = "1.1.4"
|
||||
s.description = "You should use protection!"
|
||||
s.homepage = "http://github.com/rkh/rack-protection"
|
||||
s.summary = s.description
|
||||
|
|
|
@ -19,5 +19,10 @@ describe Rack::Protection::PathTraversal do
|
|||
}.each do |a, b|
|
||||
it("replaces #{a.inspect} with #{b.inspect}") { get(a).body.should == b }
|
||||
end
|
||||
|
||||
it 'should be able to deal with PATH_INFO = nil (fcgi?)' do
|
||||
app = Rack::Protection::PathTraversal.new(proc { 42 })
|
||||
app.call({}).should be == 42
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue