This is an automated email from the ASF dual-hosted git repository.

vincbeck pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 552da84cd15 Fix duplicate Date headers in Flask WSGI responses (#64726)
552da84cd15 is described below

commit 552da84cd157be7c807c2f4014263f90833dacfd
Author: abhijeets25012-tech <[email protected]>
AuthorDate: Mon Apr 13 18:58:03 2026 +0530

    Fix duplicate Date headers in Flask WSGI responses (#64726)
---
 providers/fab/src/airflow/providers/fab/www/app.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/providers/fab/src/airflow/providers/fab/www/app.py 
b/providers/fab/src/airflow/providers/fab/www/app.py
index 0ab94e4b7ad..765d942ccc7 100644
--- a/providers/fab/src/airflow/providers/fab/www/app.py
+++ b/providers/fab/src/airflow/providers/fab/www/app.py
@@ -59,6 +59,14 @@ def create_app(enable_plugins: bool):
     from airflow.providers.fab.auth_manager.fab_auth_manager import 
FabAuthManager
 
     flask_app = Flask(__name__)
+
+    @flask_app.after_request
+    def remove_duplicate_date_header(response):
+        # Remove the application-level Date header so the ASGI/WSGI server
+        # can emit a single Date header for the final response.
+        response.headers.pop("Date", None)
+        return response
+
     flask_app.secret_key = conf.get("api", "SECRET_KEY")
     flask_app.config["SQLALCHEMY_DATABASE_URI"] = conf.get("database", 
"SQL_ALCHEMY_CONN")
     flask_app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False

Reply via email to