File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -196,9 +196,12 @@ func (h *HttpProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
196196 body , err := io .ReadAll (response .Body )
197197 if err != nil {
198198 h .log .Error (err , "failed to read response body" , "request" , r .RequestURI )
199- continue
200199 }
201200
201+ defer func () {
202+ _ = response .Body .Close ()
203+ }()
204+
202205 reportResponse .Targets = append (reportResponse .Targets , ReportTargetResponse {
203206 StatusCode : response .StatusCode ,
204207 Body : string (body ),
@@ -234,7 +237,6 @@ func (h *HttpProxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
234237 _ , err = w .Write (body )
235238 if err != nil {
236239 h .log .Error (err , "failed to write body" , "request" , r .RequestURI )
237- return
238240 }
239241
240242 return
You can’t perform that action at this time.
0 commit comments