diff options
-rw-r--r-- | urllib2_kerberos.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/urllib2_kerberos.py b/urllib2_kerberos.py index 2af1afb..b763f35 100644 --- a/urllib2_kerberos.py +++ b/urllib2_kerberos.py @@ -33,16 +33,17 @@ class AbstractKerberosAuthHandler: def negotiate_value(self, headers): """checks for "Negotiate" in proper auth header """ - authreq = headers.get(self.auth_header, None) + authreqs = headers.getheaders(self.auth_header) log.debug('authreqs = %s', authreqs) - if authreq: + if authreqs: rx = re.compile('(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I) - mo = rx.search(authreq) - if mo: - return mo.group(1) - else: - log.debug("regex failed on: %s", authreq) + for authreq in authreqs: + mo = rx.search(authreq) + if mo: + return mo.group(1) + else: + log.debug("regex failed on: %s", authreq) else: log.debug("%s header not found", self.auth_header) |