tysoncung opened a new pull request, #65086: URL: https://github.com/apache/airflow/pull/65086
## Problem HTTP responses from the Airflow webserver contain duplicate `Date` headers. This occurs because both uvicorn (the ASGI server) and Flask (mounted via WSGIMiddleware) each add their own `Date` header, violating HTTP specifications which require headers to be unique. Example: ``` date: Thu, 12 Mar 2026 04:38:44 GMT <-- from uvicorn server: uvicorn ... date: Thu, 12 Mar 2026 04:38:44 GMT <-- from Flask ``` Closes #64678 ## Solution Added `ResponseHeaderDedupMiddleware` that: - Removes duplicate headers (case-insensitive matching) - Keeps only the first occurrence of each header - Runs before `HttpAccessLogMiddleware` to ensure clean responses are logged ## Files Changed - `airflow-core/src/airflow/api_fastapi/core_api/app.py` - Added middleware registration - `airflow-core/src/airflow/api_fastapi/common/response_header_dedup.py` - New middleware implementation ## Testing This middleware ensures all responses have unique headers, regardless of whether they come from FastAPI routes or Flask routes mounted via WSGIMiddleware. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
