Skip to content

Commit 5ed0687

Browse files
committed
[fix] avoid int overflow on smaller platforms - closes #210
1 parent 732c641 commit 5ed0687

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

http_backend.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (h *httpBackend) Do(request *http.Request, bodySize int) (*Response, error)
170170
defer func(r *LimitRule) {
171171
randomDelay := time.Duration(0)
172172
if r.RandomDelay != 0 {
173-
randomDelay = time.Duration(rand.Intn(int(r.RandomDelay)))
173+
randomDelay = time.Duration(rand.Int63n(int64(r.RandomDelay)))
174174
}
175175
time.Sleep(r.Delay + randomDelay)
176176
<-r.waitChan

0 commit comments

Comments
 (0)