Merge pull request #2809 from nijel/stable

Support gzip encoding in HEAD requests
This commit is contained in:
Takeshi KOMIYA
2016-07-27 11:32:12 +09:00
committed by GitHub
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -14,6 +14,7 @@ Bugs fixed
* #2778: Fix autodoc crashes if obj.__dict__ is a property method and raises exception
* Fix duplicated toc in epub3 output.
* #2775: Fix failing linkcheck with servers not supporting identidy encoding
Release 1.4.5 (released Jul 13, 2016)
=====================================
+5
View File
@@ -56,6 +56,11 @@ opener.addheaders = [('User-agent', 'Mozilla/5.0 (X11; Linux x86_64; rv:25.0) '
class HeadRequest(Request):
"""Subclass of urllib2.Request that sends a HEAD request."""
def __init__(self, *args, **kwargs):
Request.__init__(self, *args, **kwargs)
# we do not parse the response in HEAD, so accepting anything is okay
self.headers['Accept-encoding'] = '*'
def get_method(self):
return 'HEAD'