This project is archived and is in readonly mode.
request.referrer never returns nil for no referrer
Reported by Trung | September 11th, 2010 @ 12:15 AM
# the referer of the client or '/'
def referer
@env['HTTP_REFERER'] || '/'
end
shouldn't the referrer method return nil? else this will fool me into believing that the referrer might be the homepage.
Edited by Rohit Arondekar for formating.
Comments and changes to this ticket
-
Rohit Arondekar September 11th, 2010 @ 04:30 AM
- State changed from new to open
- Importance changed from to Low
TBH I don't know, but opening ticket to get more eyes on it.
-
Jeff Kreeftmeijer September 11th, 2010 @ 06:41 AM
I think this should return
nil
. I've never seen this before but it sounds quite confusing to return/
. -
Rohit Arondekar September 11th, 2010 @ 07:59 AM
Where is this method defined again? I can't seem to find it in the Rails repo.
-
Jeff Kreeftmeijer September 11th, 2010 @ 02:22 PM
Couldn't find any method called "referer" or "referrer" either (in master). Trung? :)
-
Andrew White September 12th, 2010 @ 12:24 AM
- State changed from open to wontfix
The request object inherits from Rack::Request which is where the referer method is defined. Whilst I think it's a bit odd I don't think we should be redefining the behaviour in rails. Since you can access the value directly using request.headers there is a simple workaround and if you feel strongly about it take up the issue with the rack team.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>