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

This commit is contained in:
Alexander Marshalov 2024-02-16 15:24:59 +01:00 committed by Aliaksandr Valialkin
parent 241f5800a1
commit 760d78bb58
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB

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
}