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

undefined method `base_url' #36

Closed patsanch closed 11 years ago

patsanch commented 11 years ago

Hello,

I'm running a rails app and after upgrading to rack-protection 1.3.1, I got this error.

FATAL [2012-12-12T00:42:16.097452 ] 12724 2462 Status: 500 Internal Server Error FATAL [2012-12-12T00:42:16.097452 ] 12724 2462 undefined method base_url' for #<Rack::Request:0x007ff09468bac8> FATAL [2012-12-12T00:42:16.097452 ] 12724 2462 /home/pash/.rvm/gems/ruby-1.9.2-p290@thenation/gems/rack-protection-1.3.1/lib/rack/protection/http_origin.rb:23:inaccepts?' FATAL [2012-12-12T00:42:16.097452 ] 12724 2462 /home/pash/.rvm/gems/ruby-1.9.2-p290@thenation/gems/rack-protection-1.3.1/lib/rack/protection/base.rb:44:in call' FATAL [2012-12-12T00:42:16.097452 ] 12724 2462 /home/pash/.rvm/gems/ruby-1.9.2-p290@thenation/gems/rack-protection-1.3.1/lib/rack/protection/xss_header.rb:27:incall'

It's not happening in 1.2.0.

Also, it only happens when I'm using Safari (my version is 5.1.7). The page I'm loading is fine in Chrome and Firefox. Basically, I have a button that makes an ajax post request and it's broken in the latest version.

rkh commented 11 years ago

What Rack version are you using?

patsanch commented 11 years ago

I was using rack 1.0.1. Thanks for looking at it.

rkh commented 11 years ago

Hmmm... I checked for 1.1.3. It might work for 1.0.1, but you should really upgrade.

patsanch commented 11 years ago

Sounds good. Thank you!