You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PR fixes#40066.
Next.js' `serveStatic` method is powered by the [send](https://github.com/pillarjs/send) module, which could throw errors under specific circumstances.
Currently, Next.js only preserves the 412 Error from send, hence issue #40066 (where 416 Error is not preserved).
## Bug
- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
This closed issue has been automatically locked because it had no new activity for a month. 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
n/a
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
serveStatic swallows nearly all status codes returned by
send
and just returns 500In particular, it turns client errors like
416 Range Not Satisfiable
into 500 errors.Expected Behavior
4xx status codes should be passed through to the client.
Link to reproduction
n/a
To Reproduce
Run Next.js locally and curl any file in
public/
, egfavicon.ico
:curl -i -H 'Range: bytes=1000000000-' http://localhost:4000/favicon.ico
The text was updated successfully, but these errors were encountered: