From f1bf786a53bc59890d4a643b3e12d8279e150fb6 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sat, 29 Apr 2023 20:00:17 +0200 Subject: Incorporate multiple-auth-headers.patch --- multiple-auth-headers.patch | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 multiple-auth-headers.patch (limited to 'multiple-auth-headers.patch') 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 -# 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) -- cgit