Skip to content

Commit

Permalink
Use X-Total-Count header instead of X-Total
Browse files Browse the repository at this point in the history
as proposed in go-gitea#11114

Co-authored-by: 6543 <6543@obermui.de>
  • Loading branch information
sebastian-sauer and 6543 committed Jun 30, 2021
1 parent 8ae97b6 commit 0cc2fba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion routers/api/v1/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ func GetPullRequestCommits(ctx *context.APIContext) {

ctx.Header().Set("X-Page", strconv.Itoa(listOptions.Page))
ctx.Header().Set("X-PerPage", strconv.Itoa(listOptions.PageSize))
ctx.Header().Set("X-Total", strconv.FormatInt(int64(totalNumberOfCommits), 10))
ctx.Header().Set("X-Total-Count", fmt.Sprintf("%d", totalNumberOfCommits))
ctx.Header().Set("X-PageCount", strconv.Itoa(totalNumberOfPages))
ctx.Header().Set("X-HasMore", strconv.FormatBool(listOptions.Page < totalNumberOfPages))
ctx.JSON(http.StatusOK, &apiCommits)
Expand Down

0 comments on commit 0cc2fba

Please sign in to comment.