diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2021-12-15 14:59:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-15 14:59:57 +0800 |
commit | 4da1d9781025aa4a85899b1ddeb25aabbaa82703 (patch) | |
tree | 9714f71f2fb042e44d418fbcfc56cd8440a1bbb1 /routers/api/v1/repo/pull.go | |
parent | 9d943bf374e56e4d403303a6a2caafc1c79cdb6f (diff) | |
download | gitea-4da1d9781025aa4a85899b1ddeb25aabbaa82703.tar.gz gitea-4da1d9781025aa4a85899b1ddeb25aabbaa82703.zip |
Refactor HTTP request context (#17979)
Diffstat (limited to 'routers/api/v1/repo/pull.go')
-rw-r--r-- | routers/api/v1/repo/pull.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index 0683fe4548..4c774e8af7 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -1233,10 +1233,10 @@ func GetPullRequestCommits(ctx *context.APIContext) { ctx.SetLinkHeader(totalNumberOfCommits, listOptions.PageSize) ctx.SetTotalCountHeader(int64(totalNumberOfCommits)) - ctx.Header().Set("X-Page", strconv.Itoa(listOptions.Page)) - ctx.Header().Set("X-PerPage", strconv.Itoa(listOptions.PageSize)) - ctx.Header().Set("X-PageCount", strconv.Itoa(totalNumberOfPages)) - ctx.Header().Set("X-HasMore", strconv.FormatBool(listOptions.Page < totalNumberOfPages)) + ctx.RespHeader().Set("X-Page", strconv.Itoa(listOptions.Page)) + ctx.RespHeader().Set("X-PerPage", strconv.Itoa(listOptions.PageSize)) + ctx.RespHeader().Set("X-PageCount", strconv.Itoa(totalNumberOfPages)) + ctx.RespHeader().Set("X-HasMore", strconv.FormatBool(listOptions.Page < totalNumberOfPages)) ctx.AppendAccessControlExposeHeaders("X-Page", "X-PerPage", "X-PageCount", "X-HasMore") ctx.JSON(http.StatusOK, &apiCommits) |