summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-23 01:32:52 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-23 01:32:52 +0100
commitba655a0e4c0a80bc45d648e56ec3eb5777d599ac (patch)
treed90fdfbfd384e053c1b49f252f28bd357a6c581a
parentb59c17e543206220c1809ab0fe6131280dd02b1f (diff)
parent3d5f7a3947a8d304bc7ad46217f171996e95c475 (diff)
downloadyoutube-dl-ba655a0e4c0a80bc45d648e56ec3eb5777d599ac.tar.gz
youtube-dl-ba655a0e4c0a80bc45d648e56ec3eb5777d599ac.tar.xz
youtube-dl-ba655a0e4c0a80bc45d648e56ec3eb5777d599ac.zip
Merge remote-tracking branch 'derrotebaron/master'
-rw-r--r--youtube_dl/utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index b433b591b..3536a5bd6 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -612,7 +612,9 @@ class YoutubeDLHandler(compat_urllib_request.HTTPHandler):
 
     def http_request(self, req):
         for h, v in std_headers.items():
-            if h not in req.headers:
+            # Capitalize is needed because of Python bug 2275: http://bugs.python.org/issue2275
+            # The dict keys are capitalized because of this bug by urllib
+            if h.capitalize() not in req.headers:
                 req.add_header(h, v)
         if 'Youtubedl-no-compression' in req.headers:
             if 'Accept-encoding' in req.headers: