diff --git a/gnocchi/rest/auth_helper.py b/gnocchi/rest/auth_helper.py index d11fadf1b..d5df68939 100644 --- a/gnocchi/rest/auth_helper.py +++ b/gnocchi/rest/auth_helper.py @@ -121,7 +121,12 @@ def get_current_user(request): hdr = request.headers.get("Authorization") auth_hdr = (hdr.decode('utf-8') if isinstance(hdr, bytes) else hdr) - auth = werkzeug.http.parse_authorization_header(auth_hdr) + + try: + auth = werkzeug.http.parse_authorization_header(auth_hdr) + except AttributeError: + auth = werkzeug.datastructures.Authorization.from_header(auth_hdr) + if auth is None: api.abort(401) return auth.username diff --git a/setup.cfg b/setup.cfg index 41ed981f2..82cdfaf41 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,7 +42,7 @@ install_requires = stevedore ujson voluptuous>=0.8.10 - werkzeug<3.0.0 + werkzeug trollius; python_version < '3.4' tenacity>=5.0.0 WebOb>=1.4.1