-
-
Notifications
You must be signed in to change notification settings - Fork 92
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
5.4.0
Plugin version
12.3.1
Node.js version
24.7
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Kernel 6.17
Description
reply-from deliberately deletes a list of headers when forwarding the request to the target server (using HTTP/2, native grpc requires this).
This happens in utils.js, function stripHttp1ConnectionHeaders.
I am currently writing a small proxy with help of reply-from which converts grpc-web to native grpc.
Some of the native grpc servers I tested with expect a TE header with value "trailers" TE and refuse to work if this is missing.
I added the TE header in rewriteRequestHeaders (the client didn´t provide it) but it didn't work.
This seems also to be in the grpc standard: https://grpc.github.io/grpc/core/md_doc__p_r_o_t_o_c_o_l-_h_t_t_p2.html
Unfortunately using rewriteRequestHeaders does not work, because the stripHttp1ConnectionHeaders happens after.
Currently I work around this with a pnpm patch commenting out the case 'te': in utils.js, which works fine.
Sorry for not providing a minimal example, but I think it is easy to see in the code what happens here.
Depending on the accepted solution I would be happy to provide a MR with test to fix the problem.
Link to code that reproduces the bug
See above.
Expected Behavior
TE header should not always be deleted, or make the stripped headers configurable.