1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-22 18:22:12 +01:00

Merge pull request #1126 from dmach/0.x/fix-getallmatchingheaders

SSH auth: Fix getallmatchingheaders() output to correspond with headers.get_all()
This commit is contained in:
Daniel Mach 2022-08-31 21:14:24 +02:00 committed by GitHub
commit ed7e360368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -540,7 +540,12 @@ def _build_opener(apiurl):
if hasattr(headers, "get_all"):
all_headers = headers.get_all('www-authenticate', [])
else:
all_headers = headers.getallmatchingheaders('www-authenticate')
all_headers = []
header_name = 'www-authenticate'
for header in headers.getallmatchingheaders(header_name):
header = header[len(header_name) + 1:].lstrip()
all_headers.append(header)
for authreq in all_headers:
scheme = authreq.split()[0].lower()
authreqs[scheme] = authreq