Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
net/http: ReverseProxy doesn't handle nil request body... #12344
My code is paraphrased here (where rp is an httputil.NewSingleHostReverseProxy):
This worked in 1.4.2 but panics in 1.5 with:
goroutine 84 [running]:
I changed my NewRequest code to this: http.NewRequest("GET", meUrl, strings.NewReader("")) and it works fine.
ReverseProxy is generally used to turn incoming server requests into outgoing client requests to the proxy backend.
Server requests are guaranteed to have a non-nil body. The docs say:
Still, this is easy enough to fix.