From 326698302497c547fccd7fc0b7e80033811e092c Mon Sep 17 00:00:00 2001 From: Yifu Yu Date: Mon, 13 Jul 2026 16:49:20 +0800 Subject: [PATCH] fix(upstream-http): Properly close http body to fix goroutine leak. --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2bac3ad..254338f 100644 --- a/main.go +++ b/main.go @@ -134,7 +134,8 @@ func upstreamFiber(name string) { continue } if r.StatusCode != 200 { - fmt.Fprintf(os.Stderr, "Request to %s for stream %s failed with status code %d\n", upstreams[name], name, err) + fmt.Fprintf(os.Stderr, "Request to %s for stream %s failed with status code %d\n", upstreams[name], name, r.StatusCode) + r.Body.Close() time.Sleep(5 * time.Second) continue }