HTTP request headers and javascript

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • lefebvre@iwavesolutions.com

    #1

    HTTP request headers and javascript

    I am writing a website for a real estate client, and am using Dynamic
    HTML menus. In doing so, the way the browser moves to the next page is
    via the onclick property and changing the location.href to the next
    URL.

    The problem is that this method does not seem to send the RERRER header
    field in the HTTP request, which causes an error cause they check that
    the referrer url is correct.

    The website is on a Windows Server, and we are using ASP pages. Is
    tehre a way to add the REFERER field to our HTTP requests?

    Obviously, using the HTML <a> tag works, but our DHTML code requires it
    to be in JAVASCRIPT.

    Help!

    -Marc

  • Jay

    #2
    Re: HTTP request headers and javascript


    <lefebvre@iwave solutions.com> wrote in message
    news:1114118779 .563313.20510@z 14g2000cwz.goog legroups.com...[color=blue]
    >I am writing a website for a real estate client, and am using Dynamic
    > HTML menus. In doing so, the way the browser moves to the next page is
    > via the onclick property and changing the location.href to the next
    > URL.
    >
    > The problem is that this method does not seem to send the RERRER header
    > field in the HTTP request, which causes an error cause they check that
    > the referrer url is correct.
    >
    > The website is on a Windows Server, and we are using ASP pages. Is
    > tehre a way to add the REFERER field to our HTTP requests?
    >
    > Obviously, using the HTML <a> tag works, but our DHTML code requires it
    > to be in JAVASCRIPT.[/color]

    Can you insert some server side code into the javascript?
    <script>
    function blah() {
    var TheRef = <%=request.serv ervariable("htt p_referer")%>
    .....
    </script>

    Jay

    [color=blue]
    > Help!
    >
    > -Marc
    >[/color]


    Comment

    • kaeli

      #3
      Re: HTTP request headers and javascript

      In article <1114118779.563 313.20510@z14g2 000cwz.googlegr oups.com>,
      lefebvre@iwaves olutions.com enlightened us with...[color=blue]
      >
      > The problem is that this method does not seem to send the RERRER header
      > field in the HTTP request, which causes an error cause they check that
      > the referrer url is correct.[/color]

      Ooh, I love when people check the referer header instead of using session
      variables. That way, I can spoof away until my heart's content. ;)

      --
      --
      ~kaeli~
      Why do they sterilize the needles for lethal injections?



      Comment

      • lefebvre@iwavesolutions.com

        #4
        Re: HTTP request headers and javascript

        Yes, I could insert server side code into the javascript page.

        Here is the thing...

        I have client website www.a.com

        which has code that looks like:

        <div
        onclick="javasc ript:lcoation.h ref=http://www.b.com/xxx/yyy?cccc=ggg">

        The problem is that www.b.com checks to make sure you are coming from
        www.a.com, so I need the referer to say we are coming from www.a.com.
        For some reason its not getting passed along with this DHTML code,
        whereas a simple <a> works fine.

        I appreciate your response. Please continue with your example.

        -Marc

        Comment

        • lefebvre@iwavesolutions.com

          #5
          Re: HTTP request headers and javascript

          Yea, I think its lame that they are doing it this way, which is making
          coding this up and pain in the but.

          -Marc

          Comment

          • Jim Ley

            #6
            Re: HTTP request headers and javascript

            On 22 Apr 2005 17:23:45 -0700, lefebvre@iwaves olutions.com wrote:
            [color=blue]
            >Yea, I think its lame that they are doing it this way, which is making
            >coding this up and pain in the but.[/color]

            Simply tell them that referrer's are trivial to spoof, therefore no
            security method based on using them is worthwhile so reconsider.

            (in any case the question is answered in the links from faq 4.24)

            Jim.

            Comment

            Working...