lists.arthurdejong.org
RSS feed

webcheck commit: r405 - webcheck/schemes

[Date Prev][Date Next] [Thread Prev][Thread Next]

webcheck commit: r405 - webcheck/schemes



Author: arthur
Date: Sat Sep 11 14:43:35 2010
New Revision: 405
URL: http://arthurdejong.org/viewvc/webcheck?view=rev&revision=405

Log:
add a Referer header if possible (thanks Devin Bayer)

Modified:
   webcheck/schemes/http.py

Modified: webcheck/schemes/http.py
==============================================================================
--- webcheck/schemes/http.py    Sat Sep 11 14:31:33 2010        (r404)
+++ webcheck/schemes/http.py    Sat Sep 11 14:43:35 2010        (r405)
@@ -83,6 +83,8 @@
             # start the request
             conn.putrequest('GET', path, skip_host=True)
             conn.putheader('Host', urllib.splitport(netloc)[0])
+            if len(link.parents) > 0:
+                conn.putheader('Referer', list(link.parents)[0].url)
             if userpass is not None:
                 (user, passwd) = urllib.splitpasswd(userpass)
                 conn.putheader(
--
To unsubscribe send an email to
webcheck-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/webcheck-commits