express-http-proxy icon indicating copy to clipboard operation
express-http-proxy copied to clipboard

A empty JSON body is always set when proxying GET request

Open williamchong opened this issue 5 years ago • 1 comments

Situation: I am proxying to a server with google load balancer, which does not accept GET request with any body. I observed that even if I did not set any body in my original GET request, the proxied request always contain a empty JSON object body {} , which causes a HTTP 400 from my load balancer.

A sample failing test case, the request body always contains {} https://github.com/williamchong/express-http-proxy/commit/ba97f5700f35c2b61cf1e096e9ca4d2007db1c83

Expected: If the original GET request does not contain any body, no body should be set in the proxied request

williamchong avatar Dec 31 '20 11:12 williamchong

I got around this by setting parseReqBody to false for get requests. Not ideal but it's working

ianmaccallum avatar Sep 26 '24 20:09 ianmaccallum