mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-09 09:00:58 +00:00
Send an Accept header.
This commit is contained in:
parent
49bc50643c
commit
c076e312a2
2 changed files with 11 additions and 0 deletions
|
|
@ -1,3 +1,10 @@
|
|||
8.6 "" (released xx.xx.2014)
|
||||
|
||||
Changes:
|
||||
- checking: Add "Accept" HTTP header.
|
||||
Closes: GH bug #395
|
||||
|
||||
|
||||
8.5 "Christmas Vacation" (released 24.12.2013)
|
||||
|
||||
Features:
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ SUPPORTED_ENCODINGS = ('x-gzip', 'gzip', 'deflate')
|
|||
ACCEPT_ENCODING = ",".join(SUPPORTED_ENCODINGS)
|
||||
# Accept-Charset header value
|
||||
ACCEPT_CHARSET = "utf-8,ISO-8859-1;q=0.7,*;q=0.3"
|
||||
# Accept mime type header value
|
||||
ACCEPT = "Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
||||
|
||||
|
||||
class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledconnection.PooledConnection):
|
||||
|
|
@ -571,6 +573,8 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledc
|
|||
self.url_connection.putheader("Accept-Encoding", ACCEPT_ENCODING)
|
||||
# prefer UTF-8 encoding
|
||||
self.url_connection.putheader("Accept-Charset", ACCEPT_CHARSET)
|
||||
# prefer parseable mime types
|
||||
self.url_connection.putheader("Accept", ACCEPT)
|
||||
# send do-not-track header
|
||||
self.url_connection.putheader("DNT", "1")
|
||||
if self.aggregate.config['sendcookies']:
|
||||
|
|
|
|||
Loading…
Reference in a new issue