aboutsummaryrefslogtreecommitdiffstats
path: root/multiple-auth-headers.patch
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-04-29 20:00:17 +0200
committerMatěj Cepl <mcepl@cepl.eu>2023-04-29 20:00:17 +0200
commitf1bf786a53bc59890d4a643b3e12d8279e150fb6 (patch)
tree3d8155444a3b374ed1f06c87aeb6d2bb5ca83cd5 /multiple-auth-headers.patch
parentb3f35b93c257e4b47edc5c90c8d4c37e0d9a2c52 (diff)
downloadurllib2_kerberos-f1bf786a53bc59890d4a643b3e12d8279e150fb6.tar.gz
Incorporate multiple-auth-headers.patch
Diffstat (limited to 'multiple-auth-headers.patch')
-rw-r--r--multiple-auth-headers.patch38
1 files changed, 0 insertions, 38 deletions
diff --git a/multiple-auth-headers.patch b/multiple-auth-headers.patch
deleted file mode 100644
index bb597e2..0000000
--- a/multiple-auth-headers.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-# HG changeset patch
-# User Wagner Bruna <wbruna@softwareexpress.com.br>
-# Date 1338402998 10800
-# Node ID 5e53d94fdf9cb73304790a38ba24b19415de73ea
-# Parent 08f4f4f83058d9896a0debc2ff3899a9a358f942
-deal with multiple WWW-Authenticate headers
-
-A server supporting both Negotiate and Basic authentication methods
-could send both headers at once, but the get() method returns only
-the last one.
-
---- a/urllib2_kerberos.py
-+++ b/urllib2_kerberos.py
-@@ -41,15 +41,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)
-+
-+ if authreqs:
-
-- if authreq:
- 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)