lib/httputils: fixed error message for getting zero duration (#5795) (#5812)

(cherry picked from commit f8207e33a2)
This commit is contained in:
Alexander Marshalov 2024-02-16 15:24:59 +01:00 committed by hagen1778
parent e53f53aaf5
commit 89e9bfc276
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640

View file

@ -29,7 +29,7 @@ func GetDuration(r *http.Request, argKey string, defaultValue int64) (int64, err
}
msecs := int64(secs * 1e3)
if msecs <= 0 || msecs > maxDurationMsecs {
return 0, fmt.Errorf("%q=%dms is out of allowed range [%d ... %d]", argKey, msecs, 0, int64(maxDurationMsecs))
return 0, fmt.Errorf("%q=%dms is out of allowed range [%d ... %d]", argKey, msecs, 1, int64(maxDurationMsecs))
}
return msecs, nil
}