diff options
author | Georg Brandl <georg@python.org> | 2006-07-26 07:40:17 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2006-07-26 07:40:17 (GMT) |
commit | 0619a329e822641dff088d9141a7885da882369c (patch) | |
tree | b1d67741ba758d9bcea1080b042a9c01a5eaeda7 /Lib/urllib.py | |
parent | cf0c1729dc29fdc422f817760b8f76978fb0fa39 (diff) | |
download | cpython-0619a329e822641dff088d9141a7885da882369c.zip cpython-0619a329e822641dff088d9141a7885da882369c.tar.gz cpython-0619a329e822641dff088d9141a7885da882369c.tar.bz2 |
Bug #1459963: properly capitalize HTTP header names.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r-- | Lib/urllib.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py index 5c02883..8d56690 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -118,7 +118,7 @@ class URLopener: self.proxies = proxies self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') - self.addheaders = [('User-agent', self.version)] + self.addheaders = [('User-Agent', self.version)] self.__tempfiles = [] self.__unlink = os.unlink # See cleanup() self.tempcache = None @@ -314,8 +314,8 @@ class URLopener: h = httplib.HTTP(host) if data is not None: h.putrequest('POST', selector) - h.putheader('Content-type', 'application/x-www-form-urlencoded') - h.putheader('Content-length', '%d' % len(data)) + h.putheader('Content-Type', 'application/x-www-form-urlencoded') + h.putheader('Content-Length', '%d' % len(data)) else: h.putrequest('GET', selector) if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) @@ -400,9 +400,9 @@ class URLopener: cert_file=self.cert_file) if data is not None: h.putrequest('POST', selector) - h.putheader('Content-type', + h.putheader('Content-Type', 'application/x-www-form-urlencoded') - h.putheader('Content-length', '%d' % len(data)) + h.putheader('Content-Length', '%d' % len(data)) else: h.putrequest('GET', selector) if proxy_auth: h.putheader('Proxy-Authorization: Basic %s' % proxy_auth) @@ -584,7 +584,7 @@ class URLopener: data = base64.decodestring(data) else: data = unquote(data) - msg.append('Content-length: %d' % len(data)) + msg.append('Content-Length: %d' % len(data)) msg.append('') msg.append(data) msg = '\n'.join(msg) |