URLlib2?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rodmc

    URLlib2?

    Hi,

    Probably a silly question but I am writing a CGI script which need to
    check the referring URL, can anyone provide any pointers? I have
    looked at URLLib2 and a couple of other libraries, but am slightly
    confused.

    Thanks in advance,
    rod

  • Jarek Zgoda

    #2
    Re: URLlib2?

    rodmc napisa³(a):
    Probably a silly question but I am writing a CGI script which need to
    check the referring URL, can anyone provide any pointers? I have
    looked at URLLib2 and a couple of other libraries, but am slightly
    confused.
    Using httplib you can issue HEAD request to check if it does not return
    404 response, but this works only with HTTP/HTTPS urls.

    --
    Jarek Zgoda
    Skype: jzgoda | GTalk: zgoda@jabber.as ter.pl | voice: +48228430101

    "We read Knuth so you don't have to." (Tim Peters)

    Comment

    • Steve Holden

      #3
      Re: URLlib2?

      Jarek Zgoda wrote:
      rodmc napisa³(a):
      >
      >Probably a silly question but I am writing a CGI script which need to
      >check the referring URL, can anyone provide any pointers? I have
      >looked at URLLib2 and a couple of other libraries, but am slightly
      >confused.
      >
      Using httplib you can issue HEAD request to check if it does not return
      404 response, but this works only with HTTP/HTTPS urls.
      >
      It's unlikely that any other type of URL would result in the browser
      sending a "Referer:" header.

      regards
      Steve
      --
      Steve Holden +1 571 484 6266 +1 800 494 3119
      Holden Web LLC http://www.holdenweb.com/

      Comment

      • Bryan Olson

        #4
        Re: URLlib2?

        rodmc wrote:
        Probably a silly question but I am writing a CGI script which need to
        check the referring URL, can anyone provide any pointers? I have
        looked at URLLib2 and a couple of other libraries, but am slightly
        confused.
        When you say, "check the referring URL," what are checking about
        it? Do you just want to know from where your users came? C.l.p is
        one of Usenet's more helpful groups, but you have to clear and
        exact, or we're likely to correctly answer the wrong question.


        One reason that web sites check referring URL's is to try to
        ensure that client went through the site's intended path. The
        site might want to make sure users saw the terms-and-condition,
        or stop other sites from "deep linking", or prevent so-called
        "bandwidth theft". In these cases, checking the referrer is a
        weak solution. There is a much better method based on cookies,
        which all the popular browsers now support.

        Comment

        • Bryan Olson

          #5
          Re: URLlib2?

          rodmc wrote:
          Probably a silly question but I am writing a CGI script which need to
          check the referring URL, can anyone provide any pointers? I have
          looked at URLLib2 and a couple of other libraries, but am slightly
          confused.
          When you say, "check the referring URL," what are checking about
          it? Do you just want to know from where your users came? C.l.p is
          one of Usenet's more helpful groups, but you have to clear and
          exact, or we're likely to correctly answer the wrong question.

          There are many plausible checks one might apply to the referring
          URL. Some are trivial, some subtle.

          One reason that web servers check referring URL's is to try to
          ensure that clients go through the intended path. Perhaps the
          site simply wants to make sure users see teh terms-and-conditions,
          but more commonly it wants to stop other sites from "deep
          linking", or thwart so-called "bandwidth theft". In these cases,
          checking the referrer is a weak solution; the better method is
          based on cookies.


          --
          --Bryan

          Comment

          Working...