elazarl / goproxy

An HTTP proxy library for Go
BSD 3-Clause "New" or "Revised" License
6.06k stars 1.1k forks source link

proxy.go:165 nil pointer dereference on empty body #547

Open QuentinN42 opened 1 month ago

QuentinN42 commented 1 month ago

As the http.Response body is an interface, it may be nil.

https://github.com/elazarl/goproxy/blob/6741dbfc16a13e515d5f2b485eb4be24692e54de/proxy.go#L164-L167

Here we may want to add a if resp.Body != nil ...