Skip to content

Commit

Permalink
martian: log response body close error in connectHTTP
Browse files Browse the repository at this point in the history
  • Loading branch information
Choraden committed Nov 15, 2023
1 parent 6080252 commit 48000e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/martian/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,9 @@ func (p *Proxy) connectHTTP(req *http.Request, proxyURL *url.URL) (res *http.Res

if res != nil {
if res.StatusCode/100 == 2 {
res.Body.Close()
if err := res.Body.Close(); err != nil {
log.Errorf(req.Context(), "failed to close CONNECT response body: %v", err)
}
return proxyutil.NewResponse(200, http.NoBody, req), conn, nil
}

Expand Down

0 comments on commit 48000e7

Please sign in to comment.