Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

request.referrer never returns nil for no referrer

#5612
# 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.

Reported by Trung · September 11th, 2010 @ 12:15 AM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Rohit Arondekar
    Rohit Arondekar
    • 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.

    September 11th, 2010 @ 04:30 AM

  2. Jeff Kreeftmeijer
    Jeff Kreeftmeijer

    I think this should return nil. I've never seen this before but it sounds quite confusing to return /.

    September 11th, 2010 @ 06:41 AM

  3. Rohit Arondekar
    Rohit Arondekar

    Where is this method defined again? I can't seem to find it in the Rails repo.

    September 11th, 2010 @ 07:59 AM

  4. Jeff Kreeftmeijer
    Jeff Kreeftmeijer

    Couldn't find any method called "referer" or "referrer" either (in master). Trung? :)

    September 11th, 2010 @ 02:22 PM

  5. Andrew White
    Andrew White
    • 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.

    September 12th, 2010 @ 12:24 AM