From 41d9a273f663c87b38d46f190ad728697e156b53 Mon Sep 17 00:00:00 2001 From: kpacha Date: Mon, 15 Apr 2024 16:51:53 +0200 Subject: [PATCH] clone the body if there are one or more unsafe backends Signed-off-by: kpacha --- proxy/merging.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/proxy/merging.go b/proxy/merging.go index 6f26714b8..5d4aaf4c1 100644 --- a/proxy/merging.go +++ b/proxy/merging.go @@ -82,15 +82,12 @@ func hasUnsafeBackends(cfg *config.EndpointConfig) bool { return false } - hasOneUnsafe := false for _, b := range cfg.Backend { if m := strings.ToUpper(b.Method); m != http.MethodGet && m != http.MethodHead { - if hasOneUnsafe { - return true - } - hasOneUnsafe = true + return true } } + return false }