summaryrefslogtreecommitdiff
path: root/python3/httplib2
diff options
context:
space:
mode:
authorJoe Gregorio <jcgregorio@google.com>2011-06-13 14:06:23 -0400
committerJoe Gregorio <jcgregorio@google.com>2011-06-13 14:06:23 -0400
commit875a8b578e773e59c40083bb666739b52ec60f80 (patch)
tree5f5b2064950af60db85408dfee21703eea9d4cb1 /python3/httplib2
parentd16e2c9b4575c91ab519ec3aedd0c466238325bb (diff)
downloadhttplib2-875a8b578e773e59c40083bb666739b52ec60f80.tar.gz
Fixes issue 72. Always lowercase authorization header.
Diffstat (limited to 'python3/httplib2')
-rw-r--r--python3/httplib2/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python3/httplib2/__init__.py b/python3/httplib2/__init__.py
index 4117e59..4f60a3a 100644
--- a/python3/httplib2/__init__.py
+++ b/python3/httplib2/__init__.py
@@ -501,7 +501,7 @@ class DigestAuthentication(Authentication):
self.challenge['cnonce'],
self.challenge['qop'], H(A2)
))
- headers['Authorization'] = 'Digest username="%s", realm="%s", nonce="%s", uri="%s", algorithm=%s, response=%s, qop=%s, nc=%08x, cnonce="%s"' % (
+ headers['authorization'] = 'Digest username="%s", realm="%s", nonce="%s", uri="%s", algorithm=%s, response=%s, qop=%s, nc=%08x, cnonce="%s"' % (
self.credentials[0],
self.challenge['realm'],
self.challenge['nonce'],
@@ -574,7 +574,7 @@ class HmacDigestAuthentication(Authentication):
cnonce = _cnonce()
request_digest = "%s:%s:%s:%s:%s" % (method, request_uri, cnonce, self.challenge['snonce'], headers_val)
request_digest = hmac.new(self.key, request_digest, self.hashmod).hexdigest().lower()
- headers['Authorization'] = 'HMACDigest username="%s", realm="%s", snonce="%s", cnonce="%s", uri="%s", created="%s", response="%s", headers="%s"' % (
+ headers['authorization'] = 'HMACDigest username="%s", realm="%s", snonce="%s", cnonce="%s", uri="%s", created="%s", response="%s", headers="%s"' % (
self.credentials[0],
self.challenge['realm'],
self.challenge['snonce'],
@@ -606,7 +606,7 @@ class WsseAuthentication(Authentication):
def request(self, method, request_uri, headers, content):
"""Modify the request headers to add the appropriate
Authorization header."""
- headers['Authorization'] = 'WSSE profile="UsernameToken"'
+ headers['authorization'] = 'WSSE profile="UsernameToken"'
iso_now = time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime())
cnonce = _cnonce()
password_digest = _wsse_username_token(cnonce, iso_now, self.credentials[1])