Validates limit parameter. (#1470)

Signed-off-by: Cyril Tovena <cyril.tovena@gmail.com>
pull/1473/head
Cyril Tovena 5 years ago committed by GitHub
parent 9b264e5b2e
commit 10b5bcab72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      pkg/loghttp/params.go

@ -26,6 +26,9 @@ func limit(r *http.Request) (uint32, error) {
if err != nil {
return 0, err
}
if l <= 0 {
return 0, errors.New("limit must be a positive value")
}
return uint32(l), nil
}

Loading…
Cancel
Save