diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-18 14:22:55 -0700 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-11-18 14:22:55 -0700 |
commit | 8de1a762273323608d9d9080c42057d1814070b6 (patch) | |
tree | 88dcf3b9169f053217d799b7a49ec6587d49202a /modules/caddyhttp | |
parent | 9fe54e1c6025a45cdd531c093bb94d193a8b91a0 (diff) |
reverse_proxy: Fix invalid argument to Intn in RandomChoice selection
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r-- | modules/caddyhttp/reverseproxy/selectionpolicies.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/caddyhttp/reverseproxy/selectionpolicies.go b/modules/caddyhttp/reverseproxy/selectionpolicies.go index e34dd9b..a21e44c 100644 --- a/modules/caddyhttp/reverseproxy/selectionpolicies.go +++ b/modules/caddyhttp/reverseproxy/selectionpolicies.go @@ -132,7 +132,7 @@ func (r RandomChoiceSelection) Select(pool UpstreamPool, _ *http.Request) *Upstr if !upstream.Available() { continue } - j := weakrand.Intn(i) + j := weakrand.Intn(i + 1) if j < k { choices[j] = upstream } |