Webblocking software and using Request.ServerVariables("HTTP_REFERER")

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Elliot M. Rodriguez

    #1

    Webblocking software and using Request.ServerVariables("HTTP_REFERER")

    ..NET Framework 1.1

    Has anyone reported or experienced NullReferenceEx ception errors when
    accessing the HTTP_REFERER value on clients that are behind web blocking
    software?

    At least one of our customers uses the WatchDog WebBlocker product. Our web
    app would throw NullReferenceEx ception errors on the following line
    (assigning a Hyperlink control's NavigateURL property to the HTTP_REFERER
    value):

    lnk.NavigateUrl = Request.ServerV ariables("HTTP_ REFERER").ToStr ing();

    And return the error message:
    "Object reference not set to an instance of an object"

    Which leads me to wonder if the blocking software is also blocking
    ServerVariables in the entire HTTP request .

    I ended up having to use a Javascript line
    ("javascript:wi ndow.history.ba ck(-1)") to work around this.

    Can anyone else contribute their experiences?

    --
    Elliot M. Rodriguez, MCSD

    My .Net thoughts, comments, observations:



  • bruce barker

    #2
    Re: Webblocking software and using Request.ServerV ariables(" HTTP_REFERER&qu ot;)

    HTTP_REFERER returns the header value sent by the browser in the request.
    Null means the header was not present. Browsers do not have to send it, and
    it makes sense to strip it for security . Never have your site depend on
    this header being sent.

    -- bruce (sqlwork)


    "Elliot M. Rodriguez" <someemail> wrote in message
    news:OLgEp5X8DH A.2560@TK2MSFTN GP09.phx.gbl...[color=blue]
    > .NET Framework 1.1
    >
    > Has anyone reported or experienced NullReferenceEx ception errors when
    > accessing the HTTP_REFERER value on clients that are behind web blocking
    > software?
    >
    > At least one of our customers uses the WatchDog WebBlocker product. Our[/color]
    web[color=blue]
    > app would throw NullReferenceEx ception errors on the following line
    > (assigning a Hyperlink control's NavigateURL property to the HTTP_REFERER
    > value):
    >
    > lnk.NavigateUrl = Request.ServerV ariables("HTTP_ REFERER").ToStr ing();
    >
    > And return the error message:
    > "Object reference not set to an instance of an object"
    >
    > Which leads me to wonder if the blocking software is also blocking
    > ServerVariables in the entire HTTP request .
    >
    > I ended up having to use a Javascript line
    > ("javascript:wi ndow.history.ba ck(-1)") to work around this.
    >
    > Can anyone else contribute their experiences?
    >
    > --
    > Elliot M. Rodriguez, MCSD
    >
    > My .Net thoughts, comments, observations:
    > http://derivedclass.europe.webmatrixhosting.net
    >
    >[/color]


    Comment

    Working...