Skip to content

Commit

Permalink
validate maxResults
Browse files Browse the repository at this point in the history
  • Loading branch information
ohaibbq committed Apr 8, 2024
1 parent 05ade4e commit efb0d46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,10 @@ func (h *jobsGetQueryResultsHandler) Handle(ctx context.Context, r *jobsGetQuery
rows = nil
}

if r.maxResults < -1 {
return nil, fmt.Errorf("invalid maxResults parameter; must be greater than or equal to [-1], got [%i]", r.maxResults)

Check failure on line 1017 in server/handler.go

View workflow job for this annotation

GitHub Actions / Test (ubuntu-latest, 1.21.5)

fmt.Errorf format %i has unknown verb i
}

if r.maxResults != maxResultsDefaultValue {
rows = rows[:min(int64(len(rows)), r.maxResults)]
}
Expand Down

0 comments on commit efb0d46

Please sign in to comment.