Redirecting to test Test the Referrer HTTP Header

Discussion in 'JavaScript' started by Cholt, Aug 22, 2006.

  1. #1
    I have a web application that is testing the referrer HTTP header to perform some logic.
    I need to test this logic outside of the environment where this application is going to be used so I wrote a simple web page that has javascript that redirects the user to the web application hoping that the referrer header would be set.

    However, I have found that it is not set and I have tried a number of the methods of redirecting to try to get it to be set. Is there a way to redirect using javascript such that the website being called will have the referrer header set?

    Thanks,

    Chris
     
    Cholt, Aug 22, 2006 IP
  2. Darrin

    Darrin Peon

    Messages:
    123
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can't think of one.

    Can you grab the referrer URL and tack in onto you the URL you are going to as a parameter?
     
    Darrin, Aug 22, 2006 IP
  3. Cholt

    Cholt Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I solved my problem in a non-javascript way. I just put an anchor tag on my test page and click it. The HTTP request now comes into the web application with the referrer header set correctly.
     
    Cholt, Aug 22, 2006 IP