aboutsummaryrefslogtreecommitdiffstats
path: root/urllib2_kerberos.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2013-12-09 16:55:20 +0100
committerMatěj Cepl <mcepl@redhat.com>2013-12-09 22:21:22 +0100
commit22dc6010ac98947ae408ff5de820db4cf690bc7b (patch)
tree6cd78681f2f478cd92321b3458ec810b0eab16d5 /urllib2_kerberos.py
parent2fa15ba8e444e90d31461b1cea2968828c7a4703 (diff)
downloadurllib2_kerberos-22dc6010ac98947ae408ff5de820db4cf690bc7b.tar.gz
Don’t panick in case we succeed.
Diffstat (limited to 'urllib2_kerberos.py')
-rw-r--r--urllib2_kerberos.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/urllib2_kerberos.py b/urllib2_kerberos.py
index ecac521..84542bd 100644
--- a/urllib2_kerberos.py
+++ b/urllib2_kerberos.py
@@ -46,6 +46,7 @@ class AbstractKerberosAuthHandler:
"""checks for "Negotiate" in proper auth header
"""
authreq = headers.get(self.auth_header, None)
+ log.debug('authreq = {}'.format(authreq))
if authreq:
rx = re.compile(r'(?:.*,)*\s*Negotiate\s*([^,]*),?', re.I)
@@ -136,7 +137,8 @@ class AbstractKerberosAuthHandler:
req.add_unredirected_header(self.authz_header, neg_hdr)
resp = self.parent.open(req)
- self.authenticate_server(resp.info())
+ if resp.getcode() != 200:
+ self.authenticate_server(resp.info())
return resp