mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-30 19:55:04 -04:00
reverse_proxy: Fix invalid argument to Intn in RandomChoice selection
This commit is contained in:
parent
9fe54e1c60
commit
8de1a76227
@ -132,7 +132,7 @@ func (r RandomChoiceSelection) Select(pool UpstreamPool, _ *http.Request) *Upstr
|
|||||||
if !upstream.Available() {
|
if !upstream.Available() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
j := weakrand.Intn(i)
|
j := weakrand.Intn(i + 1)
|
||||||
if j < k {
|
if j < k {
|
||||||
choices[j] = upstream
|
choices[j] = upstream
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user