-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Internal Server Error on Non-POST w/ Body #53882
Comments
Also encountering this. It also happens with GET requests without a body if there is a |
I've had to roll back to 13.4.12 until this issue is fixed, since my app is running behind a load balancer which always adds the Content-Length header. |
I did a PR for this yesterday, it's been merged overnight. Can you try by tagging next to the |
try |
I believe that's #53843? I linked it in the original issue but the link broke. I believe that should fix the second two curl examples in the reproduction instructions, but the first will still fail. |
Tested with canary.2. The examples with empty bodies are fixed. The first is still broken. |
There's a semi-related discussion i found on undici : nodejs/undici#35 |
Also encountered this, have this have a work around. Though its funny that I try to do a |
fix 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH' when in a GET or HEAD api method provide a body ISSUES CLOSED: vercel#53882
I am on 13.4.12 and still have the same issue |
I encountered the same issue on the latest version. Downgraded the version to |
Did we have any way to print which code lines or requests caused the problem? edit: nvm, we just need to try to catch the requests. |
I also facing the same issue but It seems it's fixed in 13.5.4 version. Thanks |
I am on 13.5.6 and still having the same issue, "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH" causing with "server action" while "revalidatingTag or revalidatingPath". |
Any update on this issue? Any possible workarounds? |
Verify canary release
Provide environment information
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 or a replay of the bug
https://codesandbox.io/p/sandbox/agitated-yonath-cy9nps
To Reproduce
curl localhost:3000/example -X GET -H "Content-Type: text/plain" -d "Test"
curl localhost:3000/example -X GET -H "Content-Type: text/plain" -d ""
curl localhost:3000/example -X DELETE -H "Content-Type: text/plain" -d ""
Describe the Bug
Sending a request to an API route with a body and without the POST method causes an internal server error.
Exception:
Expected Behavior
Sending a GET or similar request with a body may or may not be correct behavior, however it should not be an error for the server. The server should either ignore the body, or return a 400 (or whatever is deemed appropriate).
Probably related: #deleteerro
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
Occurs in dev and production builds
The text was updated successfully, but these errors were encountered: