-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Fix middleware order to prevent chunked FastAPI responses #61043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix middleware order to prevent chunked FastAPI responses #61043
Conversation
|
Can you fix the issue link? |
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.
Thanks for the PR.
Could you add corresponding test case and fix the issue link? Thanks!
Srabasti
left a comment
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.
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.
pierrejeambrun
left a comment
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.
Looks good, +1 for adding a test.
|
Thanks for the review! All code-related checks are green. The remaining failures seem to be CI-related:
Requesting a re-run of the failing jobs. |
|
Agree with the e2e but the static checks are on your side ;) Running |
|
I fixed the EOF newline and spacing issue in app.py. |
|
Static checks are still failing. Please read the documentation to learn more about how to fix them. |
|
Ok , I will fix it |
pierrejeambrun
left a comment
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.
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.
Fixes #60165
Reorders JWTRefreshMiddleware, SimpleAllAdminMiddleware, and GZipMiddleware
to restore non-chunked API responses and prevent nginx duplicate Transfer-Encoding headers.