You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "JC-comp (via GitHub)" <gi...@apache.org> on 2026/03/12 04:58:25 UTC

[PR] fix(api): prevent duplicate Date headers in responses [airflow]

JC-comp opened a new pull request, #63406:
URL: https://github.com/apache/airflow/pull/63406

   ##### Description
   The deployment environments result in a duplicated Date header—one generated by the Flask application layer and another by the ASGI server. This PR introduce `StripAppDateMiddleware` to remove the 'Date' header generated by the application layer, ensuring that only one 'Date' header exists in the final response.
   ```
   $ curl -I localhost:8080/auth/static/pin_32.png 
   HTTP/1.1 200 OK
   date: Thu, 12 Mar 2026 04:38:44 GMT <-- SENT BY uvicorn
   server: uvicorn
   content-disposition: inline; filename=pin_32.png
   content-type: image/png
   content-length: 1201
   last-modified: Thu, 12 Mar 2026 01:43:44 GMT
   cache-control: no-cache
   etag: "1773279824.6871002-1201-1792155666"
   date: Thu, 12 Mar 2026 04:38:44 GMT <-- DUPLICATE SENT BY FLASK
   vary: Cookie
   ```
   ##### Changes
   - New Middleware: Added `StripAppDateMiddleware` to intercept outgoing responses.
   - App Integration: Registered the middleware in the `FastAPI` initialization flow.
   - Unit Tests: Added automated tests to verify the header is removed from the response.
   ##### How to Verify
   Unit test suite:
   1. Mocks a FastAPI request through the middleware.
   2. Asserts that the `date` key is no longer present in the `response.headers`.
   
   Manual:
   1. Run the api-server.
   2. Make a request using curl.
       ```
       $ curl -I localhost:8080/auth/static/pin_32.png 
       ```
   4. Confirm no duplicate date header.


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(api): prevent duplicate Date headers in responses [airflow]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #63406:
URL: https://github.com/apache/airflow/pull/63406#issuecomment-4043984477

   Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
   Here are some useful points:
   - Pay attention to the quality of your code (ruff, mypy and type annotations). Our [prek-hooks]( https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst#prerequisites-for-prek-hooks) will help you with that.
   - In case of a new feature add useful documentation (in docstrings or in `docs/` directory). Adding a new operator? Check this short [guide](https://github.com/apache/airflow/blob/main/airflow-core/docs/howto/custom-operator.rst) Consider adding an example DAG that shows how users should use it.
   - Consider using [Breeze environment](https://github.com/apache/airflow/blob/main/dev/breeze/doc/README.rst) for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
   - Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
   - Please follow [ASF Code of Conduct](https://www.apache.org/foundation/policies/conduct) for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
   - Be sure to read the [Airflow Coding style]( https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#coding-style-and-best-practices).
   - Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
   Apache Airflow is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@airflow.apache.org
   Slack: https://s.apache.org/airflow-slack
   


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(api): prevent duplicate Date headers in responses [airflow]

Posted by "pierrejeambrun (via GitHub)" <gi...@apache.org>.
pierrejeambrun closed pull request #63406: fix(api): prevent duplicate Date headers in responses
URL: https://github.com/apache/airflow/pull/63406


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(api): prevent duplicate Date headers in responses [airflow]

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #63406:
URL: https://github.com/apache/airflow/pull/63406#issuecomment-4179095729

   @JC-comp This PR has been converted to **draft** because it does not yet meet our [Pull Request quality criteria](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#pull-request-quality-criteria).
   
   **Issues found:**
   - :x: **Provider tests**: Failing: provider distributions tests / Providers wheel tests. Run provider tests with `breeze run pytest <provider-test-path> -xvs`. See [Provider tests docs](https://github.com/apache/airflow/blob/main/contributing-docs/12_provider_distributions.rst).
   - :x: **Other failing CI checks**: Failing: Low dep tests:core / All-core:LowestDeps:14:3.10:API...Serialization. Run `prek run --from-ref main` locally to reproduce. See [static checks docs](https://github.com/apache/airflow/blob/main/contributing-docs/08_static_code_checks.rst).
   
   > **Note:** Your branch is **531 commits behind `main`**. Some check failures may be caused by changes in the base branch rather than by your PR. Please rebase your branch and push again to get up-to-date CI results.
   
   **What to do next:**
   - The comment informs you what you need to do.
   - Fix each issue, then mark the PR as "Ready for review" in the GitHub UI - but only after making sure that all the issues are fixed.
   - There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates.
   - Maintainers will then proceed with a normal review.
   
   Converting a PR to draft is **not** a rejection — it is an invitation to bring the PR up to the project's standards so that maintainer review time is spent productively. There is no rush — take your time and work at your own pace. We appreciate your contribution and are happy to wait for updates. If you have questions, feel free to ask on the [Airflow Slack](https://s.apache.org/airflow-slack).


-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org