Fixed Python & feature test failures caused by Werkzeug 3.1.7 rejecting empty Host header in CSRF token generation.

This commit is contained in:
Anil Sahoo
2026-03-26 17:59:58 +05:30
committed by GitHub
parent 3ba887001a
commit 1c93f93a6a
@@ -93,8 +93,10 @@ class TestClient(testing.FlaskClient):
# this test client, such as the secure cookie that
# powers `flask.session`,
# and make a test request context that has those cookies in it.
server_name = self.app.config.get("SERVER_NAME") or "localhost"
environ_overrides = {
'wsgi.url_scheme': ''
'wsgi.url_scheme': 'http',
'HTTP_HOST': server_name
}
self._add_cookies_to_wsgi(environ_overrides)