From 8e7bdd6eb900b10ad54dd973a840caf53245bf70 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Wed, 5 Mar 2025 09:36:42 -0800 Subject: [PATCH] undo make sure resp body close on round trip even in error --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 05465f4..5c808d1 100644 --- a/main.go +++ b/main.go @@ -215,13 +215,13 @@ func pass(res http.ResponseWriter, req *http.Request, listenPort, proxyPort int) var transport http.Transport resp, err := transport.RoundTrip(req) - defer resp.Body.Close() if err != nil { log.Errorf("Error fetching: %v\n", err.Error()) http.Error(res, err.Error(), http.StatusServiceUnavailable) return } + defer resp.Body.Close() body, err := ioutil.ReadAll(resp.Body) if err != nil {