mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Support any encoding in HEAD requests
Completely support would be more problematic and this already covers most usual case. Fixes #2775 Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
15a251ec40
commit
a66c5811f8
1
CHANGES
1
CHANGES
@ -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)
|
||||
=====================================
|
||||
|
@ -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'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user