Browse Source
reverse_proxy: Fix invalid argument to Intn in RandomChoice selection
master
Matthew Holt
5 years ago
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with
1 additions and
1 deletions
-
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 |
|
|
|
} |
|
|
|