Send HTTP Referer header to both http and https URLs

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3741 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2008-04-29 13:33:35 +00:00
parent 285034390b
commit 92c74ece4d
2 changed files with 12 additions and 1 deletions

View file

@ -1,3 +1,13 @@
5.0unreleased "" (released xx.xx.2008)
* Require and use Python 2.5.
Type: feature
Changed: *.py
* Send HTTP Referer header for both http and https URLs.
Type: feature
Changed: linkcheck/checker/httpurl.py
4.9 "Michael Clayton" (released 25.4.2008)
* Parse Shockwave Flash (SWF) for URLs to check

View file

@ -478,7 +478,8 @@ Use URL %s instead for checking."""), self.url, newurl)
if self.proxyauth:
self.url_connection.putheader("Proxy-Authorization",
self.proxyauth)
if self.parent_url and self.parent_url.startswith('http://'):
if (self.parent_url and
self.parent_url.startswith(('http://', 'https://'))):
self.url_connection.putheader("Referer", self.parent_url)
self.url_connection.putheader("User-Agent",
linkcheck.configuration.UserAgent)