reverse_proxy: Fix invalid argument to Intn in RandomChoice selection

This commit is contained in:
Matthew Holt 2019-11-18 14:22:55 -07:00
parent 9fe54e1c60
commit 8de1a76227
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
1 changed files with 1 additions and 1 deletions

View File

@ -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
}