mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Add Access-Control-Expose-Headers (#12446)
Fix #12424 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
@@ -173,6 +173,8 @@ func SearchIssues(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
ctx.SetLinkHeader(issueCount, setting.UI.IssuePagingNum)
|
||||
ctx.Header().Set("X-Total-Count", fmt.Sprintf("%d", issueCount))
|
||||
ctx.Header().Set("Access-Control-Expose-Headers", "X-Total-Count, Link")
|
||||
ctx.JSON(http.StatusOK, convert.ToAPIIssueList(issues))
|
||||
}
|
||||
|
||||
@@ -322,6 +324,7 @@ func ListIssues(ctx *context.APIContext) {
|
||||
|
||||
ctx.SetLinkHeader(ctx.Repo.Repository.NumIssues, listOptions.PageSize)
|
||||
ctx.Header().Set("X-Total-Count", fmt.Sprintf("%d", ctx.Repo.Repository.NumIssues))
|
||||
ctx.Header().Set("Access-Control-Expose-Headers", "X-Total-Count, Link")
|
||||
|
||||
ctx.JSON(http.StatusOK, convert.ToAPIIssueList(issues))
|
||||
}
|
||||
|
Reference in New Issue
Block a user