Skip to content

Commit 552da84

Browse files
Fix duplicate Date headers in Flask WSGI responses (#64726)
1 parent cb7f6af commit 552da84

File tree

1 file changed

+8
-0
lines changed
  • providers/fab/src/airflow/providers/fab/www

1 file changed

+8
-0
lines changed

providers/fab/src/airflow/providers/fab/www/app.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ def create_app(enable_plugins: bool):
5959
from airflow.providers.fab.auth_manager.fab_auth_manager import FabAuthManager
6060

6161
flask_app = Flask(__name__)
62+
63+
@flask_app.after_request
64+
def remove_duplicate_date_header(response):
65+
# Remove the application-level Date header so the ASGI/WSGI server
66+
# can emit a single Date header for the final response.
67+
response.headers.pop("Date", None)
68+
return response
69+
6270
flask_app.secret_key = conf.get("api", "SECRET_KEY")
6371
flask_app.config["SQLALCHEMY_DATABASE_URI"] = conf.get("database", "SQL_ALCHEMY_CONN")
6472
flask_app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False

0 commit comments

Comments
 (0)