Merge pull request #5101 from pallets/update-werkzeug
update werkzeug to >=2.3.3
This commit is contained in:
commit
adedb2a64e
3 changed files with 10 additions and 20 deletions
|
|
@ -3,8 +3,8 @@ Version 2.3.2
|
||||||
|
|
||||||
Unreleased
|
Unreleased
|
||||||
|
|
||||||
- Session cookie sets ``Vary: Cookie`` header when it is accessed, modified, cleared,
|
- Set ``Vary: Cookie`` header when the session is accessed, modified, or refreshed.
|
||||||
or refreshed.
|
- Update Werkzeug requirement to >=2.3.3 to apply recent bug fixes.
|
||||||
|
|
||||||
|
|
||||||
Version 2.3.1
|
Version 2.3.1
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ classifiers = [
|
||||||
]
|
]
|
||||||
requires-python = ">=3.8"
|
requires-python = ">=3.8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"Werkzeug>=2.3.0",
|
"Werkzeug>=2.3.3",
|
||||||
"Jinja2>=3.1.2",
|
"Jinja2>=3.1.2",
|
||||||
"itsdangerous>=2.1.2",
|
"itsdangerous>=2.1.2",
|
||||||
"click>=8.1.3",
|
"click>=8.1.3",
|
||||||
|
|
|
||||||
|
|
@ -138,21 +138,14 @@ class FlaskClient(Client):
|
||||||
:meth:`~flask.Flask.test_request_context` which are directly
|
:meth:`~flask.Flask.test_request_context` which are directly
|
||||||
passed through.
|
passed through.
|
||||||
"""
|
"""
|
||||||
# new cookie interface for Werkzeug >= 2.3
|
if self._cookies is None:
|
||||||
cookie_storage = self._cookies if hasattr(self, "_cookies") else self.cookie_jar
|
|
||||||
|
|
||||||
if cookie_storage is None:
|
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
"Cookies are disabled. Create a client with 'use_cookies=True'."
|
"Cookies are disabled. Create a client with 'use_cookies=True'."
|
||||||
)
|
)
|
||||||
|
|
||||||
app = self.application
|
app = self.application
|
||||||
ctx = app.test_request_context(*args, **kwargs)
|
ctx = app.test_request_context(*args, **kwargs)
|
||||||
|
self._add_cookies_to_wsgi(ctx.request.environ)
|
||||||
if hasattr(self, "_add_cookies_to_wsgi"):
|
|
||||||
self._add_cookies_to_wsgi(ctx.request.environ)
|
|
||||||
else:
|
|
||||||
self.cookie_jar.inject_wsgi(ctx.request.environ) # type: ignore[union-attr]
|
|
||||||
|
|
||||||
with ctx:
|
with ctx:
|
||||||
sess = app.session_interface.open_session(app, ctx.request)
|
sess = app.session_interface.open_session(app, ctx.request)
|
||||||
|
|
@ -169,14 +162,11 @@ class FlaskClient(Client):
|
||||||
with ctx:
|
with ctx:
|
||||||
app.session_interface.save_session(app, sess, resp)
|
app.session_interface.save_session(app, sess, resp)
|
||||||
|
|
||||||
if hasattr(self, "_update_cookies_from_response"):
|
self._update_cookies_from_response(
|
||||||
self._update_cookies_from_response(
|
ctx.request.host.partition(":")[0],
|
||||||
ctx.request.host.partition(":")[0], resp.headers.getlist("Set-Cookie")
|
ctx.request.path,
|
||||||
)
|
resp.headers.getlist("Set-Cookie"),
|
||||||
else:
|
)
|
||||||
self.cookie_jar.extract_wsgi( # type: ignore[union-attr]
|
|
||||||
ctx.request.environ, resp.headers
|
|
||||||
)
|
|
||||||
|
|
||||||
def _copy_environ(self, other):
|
def _copy_environ(self, other):
|
||||||
out = {**self.environ_base, **other}
|
out = {**self.environ_base, **other}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue