sinatra / rack-protection

NOTE: This project has been merged upstream to sinatra/sinatra
https://github.com/sinatra/sinatra/tree/master/rack-protection
818 stars 58 forks source link

Spec for escaped_params handling of POST bodies #42

Closed skade closed 11 years ago

skade commented 11 years ago

Hi,

I just wrote a small spec to validate how escaped_params handles POSTs. As I didn't want to waste a perfectly good piece of code, heres a pull request.

Best, Florian

rkh commented 11 years ago

Test is failing on Travis :(

skade commented 11 years ago

Thats rather interesting, because "/bar/batz" fails for me (ruby-1.9.3-p125, rack 1.5.0):

  1) Rack::Protection::EscapedParams escaping escapes slashes in post bodys
     Failure/Error: body.should == "/bar/batz"
       expected: "/bar/batz"
            got: "/bar/batz" (using ==)
     # ./spec/escaped_params_spec.rb:50:in `block (3 levels) in <top (required)>'

and 1.8.7 doesn't seem to escape at all...

skade commented 11 years ago

I'll close this one and reopen if I find time to work on it again.