From b3f602e7c585b04decdfba678e7a223ca79ecf1a Mon Sep 17 00:00:00 2001 From: Paul Brand Date: Sun, 5 May 2024 21:32:49 +0200 Subject: [PATCH] Fix acceptance tests with latests flask and werkzeug --- atests/http_server/core.py | 2 +- atests/http_server/helpers.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/atests/http_server/core.py b/atests/http_server/core.py index 05e8ac77..6ec313d5 100644 --- a/atests/http_server/core.py +++ b/atests/http_server/core.py @@ -188,6 +188,6 @@ def redirect_to(): status_code = int(args["status_code"]) if status_code >= 300 and status_code < 400: response.status_code = status_code - response.headers["Location"] = args["url"].encode("utf-8") + response.headers["Location"] = args["url"] return response diff --git a/atests/http_server/helpers.py b/atests/http_server/helpers.py index b65f91f6..0c1b5d65 100644 --- a/atests/http_server/helpers.py +++ b/atests/http_server/helpers.py @@ -13,8 +13,7 @@ import time import os from hashlib import md5, sha256, sha512 -from werkzeug.http import parse_authorization_header -from werkzeug.datastructures import WWWAuthenticate +from werkzeug.datastructures import WWWAuthenticate, Authorization from flask import request, make_response from six.moves.urllib.parse import urlparse, urlunparse @@ -357,7 +356,7 @@ def check_digest_auth(user, passwd): """Check user authentication using HTTP Digest auth""" if request.headers.get('Authorization'): - credentials = parse_authorization_header(request.headers.get('Authorization')) + credentials = Authorization.from_header(request.headers.get('Authorization')) if not credentials: return request_uri = request.script_root + request.path