Skip to content
Prev Previous commit
Next Next commit
refactor(api/log): cap max per_page at 100
  • Loading branch information
cognifloyd committed Mar 25, 2023
commit 404163ce8ca4a6269237f8b5430f9395725dcf38
4 changes: 2 additions & 2 deletions api/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import (
// name: per_page
// description: How many results per page to return
// type: integer
// maximum: 500
// maximum: 100
// default: 100
// security:
// - ApiKeyAuth: []
Expand Down Expand Up @@ -113,7 +113,7 @@ func GetBuildLogs(c *gin.Context) {
}

// ensure per_page isn't above or below allowed values
perPage = util.MaxInt(1, util.MinInt(500, perPage))
perPage = util.MaxInt(1, util.MinInt(100, perPage))

// send API call to capture the list of logs for the build
l, t, err := database.FromContext(c).ListLogsForBuild(b, page, perPage)
Expand Down