fastify-http-proxy
fastify-http-proxy copied to clipboard
All DELETE requests are failling when using HTTP2
Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the bug has not already been reported
Fastify version
3.x.x
Plugin version
7.1.0
Node.js version
16.x.x
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Fedora 35
Description
When running any DELETE
request without a body with HTTP2 we got the following error:
{
"statusCode": 500,
"code": "UND_ERR_REQ_CONTENT_LENGTH_MISMATCH",
"error": "Internal Server Error",
"message": "Request body length does not match content-length header"
}
If we run the same request with HTTP1, the error doesn't happen
Even if we use http2: false
on the proxy options, we still got that error if the request was executed with HTTP2
Also, seems like Undici doesn't support HTTP2 yet, maybe that's the reason?
Steps to Reproduce
- Create a new application
- Add a proxy to another application that has a valid
DELETE
endpoint - Execute a request to that
DELETE
endpoint using HTTP2
Expected Behavior
The request should be executed as expected
Thanks for reporting!
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
I'm not sure what the problem is but it would be awesome if you'd try a fix!
@mcollina sure 😄
I was trying to debug it for a while and just stopped. Next monday I'll try to create a sample repo with it and share with you over here 😄