mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-27 06:03:48 +03:00
reverse_proxy: Fix invalid argument to Intn in RandomChoice selection
This commit is contained in:
parent
9fe54e1c60
commit
8de1a76227
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue