mirror of https://github.com/caddyserver/caddy.git
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() {
|
||||
continue
|
||||
}
|
||||
j := weakrand.Intn(i)
|
||||
j := weakrand.Intn(i + 1)
|
||||
if j < k {
|
||||
choices[j] = upstream
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue