-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
Next 13.4 API routes gzip already gzipped content #49963
Comments
Any updates on this? This is a regression from everything before Next.js 13.4.x. This code has been working since Next.js 8.x |
Just tested and 13.4.9 still has the issue. |
Still broken in 13.4.12 |
Looks like this is fixed in |
Verified fixed in |
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Jan 27 02:56:13 UTC 2023 Binaries: Node: 18.16.0 npm: 9.5.1 Yarn: N/A pnpm: N/A Relevant packages: next: 13.4.2 eslint-config-next: 13.4.2 react: 18.2.0 react-dom: 18.2.0 typescript: 5.0.4
Which area(s) of Next.js are affected? (leave empty if unsure)
Middleware / Edge (API routes, runtime)
Link to the code that reproduces this issue
https://github.com/tkmcmaster/next13gzip
To Reproduce
Browser:
http://localhost:3000/api/hello
http://localhost:3000/api/gzip
Describe the Bug
Next.js API layer appears to be gzipping already gzipped data starting in Next.13.4.x. In Next 13.2 and 13.3 an already gzipped readable will be correctly read by the receiving browser. But starting in Next 13.4 that is no longer the case. The browser gets what appears to be binary data.
The example above uses a pure Readable. The real data I'm using comes from an already Gzipped AWS S3 Object Body.
If I downgrade to Next 13.2.4 on the example above, loading those URLs in Chrome both work.
Expected Behavior
If the
Content-Encoding
header is already set togzip
, the API layer shouldn't add it's own gzip.Which browser are you using? (if relevant)
Chrome 113
How are you deploying your application? (if relevant)
AWS
The text was updated successfully, but these errors were encountered: