MCPcopy
hub / github.com/pallets/werkzeug / _update_cookies_from_response

Method _update_cookies_from_response

src/werkzeug/test.py:959–978  ·  view source on GitHub ↗

If cookies are enabled, update the stored cookies from any ``Set-Cookie`` headers in the response. :meta private: .. versionadded:: 2.3

(
        self, server_name: str, path: str, headers: list[str]
    )

Source from the content-addressed store, hash-verified

957 environ.pop("HTTP_COOKIE", None)
958
959 def _update_cookies_from_response(
960 self, server_name: str, path: str, headers: list[str]
961 ) -> None:
962 """If cookies are enabled, update the stored cookies from any ``Set-Cookie``
963 headers in the response.
964
965 :meta private:
966
967 .. versionadded:: 2.3
968 """
969 if self._cookies is None:
970 return
971
972 for header in headers:
973 cookie = Cookie._from_response_header(server_name, path, header)
974
975 if cookie._should_delete:
976 self._cookies.pop(cookie._storage_key, None)
977 else:
978 self._cookies[cookie._storage_key] = cookie
979
980 def run_wsgi_app(
981 self, environ: WSGIEnvironment, buffered: bool = False

Callers 1

run_wsgi_appMethod · 0.95

Calls 2

_from_response_headerMethod · 0.80
popMethod · 0.45

Tested by

no test coverage detected