From 7a112d86a2cad990ef00da3ca9a12bbac1b9c26b Mon Sep 17 00:00:00 2001 From: cl3t4p <61201782+cl3t4p@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:26:29 +0200 Subject: [PATCH] Update response header in make_auth_required_response function Signed-off-by: cl3t4p <61201782+cl3t4p@users.noreply.github.com> --- flask_simpleldap/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flask_simpleldap/__init__.py b/flask_simpleldap/__init__.py index 1d3867d..8b4cbf3 100644 --- a/flask_simpleldap/__init__.py +++ b/flask_simpleldap/__init__.py @@ -421,7 +421,7 @@ def basic_auth_required(self, func): def make_auth_required_response(): response = make_response("Unauthorized", 401) - response.www_authenticate.set_basic(current_app.config["LDAP_REALM_NAME"]) + response.headers['WWW-Authenticate'] = f'Basic realm="{current_app.config["LDAP_REALM_NAME"]}"' return response @wraps(func)