If cookies are enabled, set the ``Cookie`` header in the environ to the cookies that are applicable to the request host and path. :meta private: .. versionadded:: 2.3
(self, environ: WSGIEnvironment)
| 933 | self._cookies.pop((domain, path, key), None) |
| 934 | |
| 935 | def _add_cookies_to_wsgi(self, environ: WSGIEnvironment) -> None: |
| 936 | """If cookies are enabled, set the ``Cookie`` header in the environ to the |
| 937 | cookies that are applicable to the request host and path. |
| 938 | |
| 939 | :meta private: |
| 940 | |
| 941 | .. versionadded:: 2.3 |
| 942 | """ |
| 943 | if self._cookies is None: |
| 944 | return |
| 945 | |
| 946 | url = urlsplit(get_current_url(environ)) |
| 947 | server_name = url.hostname or "localhost" |
| 948 | value = "; ".join( |
| 949 | c._to_request_header() |
| 950 | for c in self._cookies.values() |
| 951 | if c._matches_request(server_name, url.path) |
| 952 | ) |
| 953 | |
| 954 | if value: |
| 955 | environ["HTTP_COOKIE"] = value |
| 956 | else: |
| 957 | environ.pop("HTTP_COOKIE", None) |
| 958 | |
| 959 | def _update_cookies_from_response( |
| 960 | self, server_name: str, path: str, headers: list[str] |
no test coverage detected