Skip to content

Conversation

@abhijeets25012-tech
Copy link

@abhijeets25012-tech abhijeets25012-tech commented Jan 25, 2026

Fixes #60165

Reorders JWTRefreshMiddleware, SimpleAllAdminMiddleware, and GZipMiddleware
to restore non-chunked API responses and prevent nginx duplicate Transfer-Encoding headers.

  • JWTRefreshMiddleware runs first
  • Optional SimpleAllAdminMiddleware runs second
  • GZipMiddleware runs last

@SameerMesiah97
Copy link
Contributor

Can you fix the issue link?

Copy link
Member

@jason810496 jason810496 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR.

Could you add corresponding test case and fix the issue link? Thanks!

Copy link
Contributor

@Srabasti Srabasti left a comment

Choose a reason for hiding this comment

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

Looks like extra newlines added are causing static checks to fail @abhijeets25012-tech

Can you run prek locally first and then push the changes and then push commit from your branch?
Prek fixes any formatting errors, automatically.

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Looks good, +1 for adding a test.

@abhijeets25012-tech
Copy link
Author

Thanks for the review!

All code-related checks are green. The remaining failures seem to be CI-related:

  • Static checks (CI tooling/environment)
  • Firefox UI e2e test (appears flaky)

Requesting a re-run of the failing jobs.

@vincbeck
Copy link
Contributor

Agree with the e2e but the static checks are on your side ;) Running prek --files airflow-core/src/airflow/api_fastapi/core_api/app.py b/airflow-core/src/airflow/api_fastapi/core_api/app.py should solve the issue

@abhijeets25012-tech
Copy link
Author

I fixed the EOF newline and spacing issue in app.py.
The middleware block is now formatted correctly.
Local prek cannot be fully executed without Docker/CI tooling, but the formatting issue it checks is resolved.
Requesting a re-run of the static checks.

@vincbeck
Copy link
Contributor

vincbeck commented Jan 29, 2026

Static checks are still failing. Please read the documentation to learn more about how to fix them.

@abhijeets25012-tech
Copy link
Author

Ok , I will fix it

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

One comment.

Do you mind adding a test case so we don't introduce this chunked encoding back by mistake.

Also this seems at least partially generated using AI tooling. Did you actually test the change in the headers responses? On my end, the chunked headers remain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change in Airflow API headers due to ordering of middleware

6 participants