Skip to content

Commit

Permalink
Merge pull request #18 from gardener/fix_return_limit_rows
Browse files Browse the repository at this point in the history
Only return limit number of rows
  • Loading branch information
lsroe authored Oct 16, 2024
2 parents 295601d + ef9d81f commit 46a571b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,13 @@ func newHandlePull(backendConf backendConf) func(http.ResponseWriter, *http.Requ
log.Errorf("Could not generate continue filter: %v", err)
}

output := map[string]interface{}{"response": rows}
output := make(map[string]interface{})
if len(rows) <= filter.Limit {
output["response"] = rows
} else {
output["response"] = rows[:filter.Limit]
}

if conFilter != nil {
output["continueFilter"] = conFilter
}
Expand Down Expand Up @@ -390,7 +396,6 @@ func parseFilter(vals url.Values) (Filter, error) {
return filter, nil
}

log.Info(filterStr)
err := json.Unmarshal([]byte(filterStr), &filter)
if err != nil {
log.Errorf("Errror unmarshalling: %v", err)
Expand Down

0 comments on commit 46a571b

Please sign in to comment.