1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-03 00:45:22 +02: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:
zeripath 2020-08-13 18:18:18 +01:00 committed by GitHub
parent e266ba30cc
commit 2ef318e6f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 19 additions and 0 deletions

View file

@ -43,6 +43,7 @@ func listUserRepos(ctx *context.APIContext, u *models.User, private bool) {
ctx.SetLinkHeader(int(count), opts.PageSize)
ctx.Header().Set("X-Total-Count", strconv.FormatInt(count, 10))
ctx.Header().Set("Access-Control-Expose-Headers", "X-Total-Count, Link")
ctx.JSON(http.StatusOK, &apiRepos)
}
@ -129,6 +130,7 @@ func ListMyRepos(ctx *context.APIContext) {
ctx.SetLinkHeader(int(count), opts.ListOptions.PageSize)
ctx.Header().Set("X-Total-Count", strconv.FormatInt(count, 10))
ctx.Header().Set("Access-Control-Expose-Headers", "X-Total-Count, Link")
ctx.JSON(http.StatusOK, &results)
}