mirror of
https://github.com/sinatra/sinatra
synced 2023-03-27 23:18:01 -04:00
allow cache-breaker params in EscapedParams
This commit is contained in:
parent
47c9f73934
commit
1e0710abfc
2 changed files with 11 additions and 1 deletions
|
@ -66,7 +66,7 @@ module Rack
|
|||
when Hash then escape_hash(object)
|
||||
when Array then object.map { |o| escape(o) }
|
||||
when String then escape_string(object)
|
||||
else raise ArgumentError, "cannot escape #{object.inspect}"
|
||||
else nil
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -30,5 +30,15 @@ describe Rack::Protection::EscapedParams do
|
|||
get '/', :foo => {:bar => "<bar>"}
|
||||
body.should == '<bar>'
|
||||
end
|
||||
|
||||
it 'leaves cache-breaker params untouched' do
|
||||
mock_app do |env|
|
||||
request = Rack::Request.new(env)
|
||||
[200, {'Content-Type' => 'text/plain'}, ['hi']]
|
||||
end
|
||||
|
||||
get '/?95df8d9bf5237ad08df3115ee74dcb10'
|
||||
body.should == 'hi'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue