GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(webserver): remove duplicate Date headers in responses by tysoncung · Pull Request #65086 · apache/airflow

Conversation

@tysoncung

@tysoncung tysoncung commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@tysoncung
fix(webserver): remove duplicate Date headers in responses (apache#64678
a3b9eb6
)

- Add ResponseHeaderDedupMiddleware to remove duplicate response headers
- Fixes issue where both uvicorn and Flask add Date headers
- Middleware keeps only the first occurrence of each header (case-insensitive)
- Applied before HttpAccessLogMiddleware to ensure clean responses

Closes apache#64678
@tysoncung
tysoncung requested review from bugraoz93, choo121600, ephraimbuddy, jason810496, pierrejeambrun, rawwar and shubhamraj-git as code owners April 12, 2026 14:39
@boring-cyborg boring-cyborg Bot added the area:API Airflow's REST/HTTP API label Apr 12, 2026
pierrejeambrun
pierrejeambrun reviewed Apr 14, 2026
View reviewed changes

@pierrejeambrun pierrejeambrun left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding a middleware that will strip out the duplicated headers. Can we instead fix the ASGI app (flask) to not include that unwanted Date header ?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@potiuk
potiuk marked this pull request as draft April 22, 2026 18:19
@potiuk

potiuk commented Apr 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@tysoncung Converting to draft — this PR doesn't yet meet our Pull Request quality criteria.

  • ❌ Failing CI — broad regression: 10+ checks are failing, including multiple e2e test suites (Regular e2e test, Elasticsearch remote logging e2e, Remote logging e2e, XCom object storage backend e2e), all three K8S System:* executors on 1.30.13, plus Task SDK integration and Airflow CTL integration. The pattern is too broad to be flaky — it looks like the change breaks how deployed tasks see the webserver. Please investigate: start with a local breeze k8s run-complete-tests and the Task SDK integration suite.

See the linked criteria for how to fix each item, then mark the PR "Ready for review". This is not a rejection — just an invitation to bring the PR up to standard. No rush.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@potiuk

potiuk commented May 5, 2026

Copy link
Copy Markdown
Member

@tysoncung This draft PR has been inactive for 13 days since the last triage comment and no response from the author. Closing to keep the queue clean.

You are welcome to reopen this PR when you resume work, or to open a new one addressing the issues previously raised. There is no rush — take your time.


Note: This comment was drafted by an AI-assisted triage tool and may contain mistakes. Once you have addressed the points above, an Apache Airflow maintainer — a real person — will take the next look at your PR. We use this two-stage triage process so that our maintainers' limited time is spent where it matters most: the conversation with you.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@potiuk potiuk closed this May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@pierrejeambrun pierrejeambrun pierrejeambrun left review comments
@ephraimbuddy ephraimbuddy Awaiting requested review from ephraimbuddy ephraimbuddy is a code owner
@rawwar rawwar Awaiting requested review from rawwar
@jason810496 jason810496 Awaiting requested review from jason810496 jason810496 is a code owner
@bugraoz93 bugraoz93 Awaiting requested review from bugraoz93 bugraoz93 is a code owner
@shubhamraj-git shubhamraj-git Awaiting requested review from shubhamraj-git shubhamraj-git is a code owner
@choo121600 choo121600 Awaiting requested review from choo121600 choo121600 is a code owner
@henry3260 henry3260 Awaiting requested review from henry3260 henry3260 will be requested when the pull request is marked ready for review henry3260 is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Duplicate Date headers in responses

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@tysoncung @potiuk @pierrejeambrun
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.