From 96cac81a88492a4fe67dc749c8677f179aaa7175 Mon Sep 17 00:00:00 2001 From: Daniel Mach Date: Wed, 31 Aug 2022 20:15:08 +0200 Subject: [PATCH] SSH auth: Fix getallmatchingheaders() output to correspond with headers.get_all() --- osc/conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/osc/conf.py b/osc/conf.py index e3be9297..ed7bedee 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -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