Skip to content

Commit

Permalink
clone the body if there are one or more unsafe backends
Browse files Browse the repository at this point in the history
Signed-off-by: kpacha <[email protected]>
  • Loading branch information
kpacha committed Apr 15, 2024
1 parent 21b17ce commit 41d9a27
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions proxy/merging.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 41d9a27

Please sign in to comment.