forked from orbit-oss/flask
werkzeug 2.3.3 compatibility
This commit is contained in:
parent
726d3f4fa9
commit
3fbfbad79f
2 changed files with 16 additions and 3 deletions
|
|
@ -3,6 +3,8 @@ Version 2.2.5
|
||||||
|
|
||||||
Unreleased
|
Unreleased
|
||||||
|
|
||||||
|
- Update for compatibility with Werkzeug 2.3.3.
|
||||||
|
|
||||||
|
|
||||||
Version 2.2.4
|
Version 2.2.4
|
||||||
-------------
|
-------------
|
||||||
|
|
|
||||||
|
|
@ -168,10 +168,21 @@ class FlaskClient(Client):
|
||||||
app.session_interface.save_session(app, sess, resp)
|
app.session_interface.save_session(app, sess, resp)
|
||||||
|
|
||||||
if hasattr(self, "_update_cookies_from_response"):
|
if hasattr(self, "_update_cookies_from_response"):
|
||||||
self._update_cookies_from_response(
|
try:
|
||||||
ctx.request.host.partition(":")[0], resp.headers.getlist("Set-Cookie")
|
# Werkzeug>=2.3.3
|
||||||
)
|
self._update_cookies_from_response(
|
||||||
|
ctx.request.host.partition(":")[0],
|
||||||
|
ctx.request.path,
|
||||||
|
resp.headers.getlist("Set-Cookie"),
|
||||||
|
)
|
||||||
|
except TypeError:
|
||||||
|
# Werkzeug>=2.3.0,<2.3.3
|
||||||
|
self._update_cookies_from_response( # type: ignore[call-arg]
|
||||||
|
ctx.request.host.partition(":")[0],
|
||||||
|
resp.headers.getlist("Set-Cookie"), # type: ignore[arg-type]
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
|
# Werkzeug<2.3.0
|
||||||
self.cookie_jar.extract_wsgi( # type: ignore[union-attr]
|
self.cookie_jar.extract_wsgi( # type: ignore[union-attr]
|
||||||
ctx.request.environ, resp.headers
|
ctx.request.environ, resp.headers
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue