Skip to content
Snippets Groups Projects
Commit 0570b278 authored by Antoine Lambert's avatar Antoine Lambert
Browse files

pytest_plugin: Fix error since werkzeug 3.1 release

Since werkzeug 3.1 release, A CaseInsensitiveDict from requests
library can no longer be initialized with a Headers object from
werkzeug. Explicitly converting a Headers object to a list of
tuples is now required.
parent 72aea6d5
Branches fix-error-with-werkzeug-3.1
No related tags found
No related merge requests found
Pipeline #11850 passed
......@@ -273,7 +273,10 @@ class RPCTestAdapter(BaseAdapter):
response.status_code = resp.status_code
# Make headers case-insensitive.
response.headers = CaseInsensitiveDict(getattr(resp, "headers", {}))
headers = getattr(resp, "headers")
response.headers = CaseInsensitiveDict(
headers.to_wsgi_list() if headers else []
)
# Set encoding.
response.encoding = get_encoding_from_headers(response.headers)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment