Skip to content

Commit

Permalink
Merge pull request #722 from luraproject/fix_body_clone
Browse files Browse the repository at this point in the history
clone the body if there are one or more unsafe backends
  • Loading branch information
kpacha authored Apr 16, 2024
2 parents 21b17ce + 41d9a27 commit 75be043
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 75be043

Please sign in to comment.