summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/admin
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-08-13 18:18:18 +0100
committerGitHub <noreply@github.com>2020-08-13 18:18:18 +0100
commit2ef318e6f1d0c674e894d2d1f25ca79498663466 (patch)
tree4914d7c95e814af2ffdc8ea7101b6f1b86e03ae4 /routers/api/v1/admin
parente266ba30cca17bdb5c50fd0cd30d2e429e58ac26 (diff)
downloadgitea-2ef318e6f1d0c674e894d2d1f25ca79498663466.tar.gz
gitea-2ef318e6f1d0c674e894d2d1f25ca79498663466.zip
Add Access-Control-Expose-Headers (#12446)
Fix #12424 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'routers/api/v1/admin')
-rw-r--r--routers/api/v1/admin/org.go1
-rw-r--r--routers/api/v1/admin/user.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go
index 62d485d821..0fd9e17f41 100644
--- a/routers/api/v1/admin/org.go
+++ b/routers/api/v1/admin/org.go
@@ -121,5 +121,6 @@ func GetAllOrgs(ctx *context.APIContext) {
ctx.SetLinkHeader(int(maxResults), listOptions.PageSize)
ctx.Header().Set("X-Total-Count", fmt.Sprintf("%d", maxResults))
+ ctx.Header().Set("Access-Control-Expose-Headers", "X-Total-Count, Link")
ctx.JSON(http.StatusOK, &orgs)
}
diff --git a/routers/api/v1/admin/user.go b/routers/api/v1/admin/user.go
index 153ce66d76..a8a573eaf0 100644
--- a/routers/api/v1/admin/user.go
+++ b/routers/api/v1/admin/user.go
@@ -370,5 +370,6 @@ func GetAllUsers(ctx *context.APIContext) {
ctx.SetLinkHeader(int(maxResults), listOptions.PageSize)
ctx.Header().Set("X-Total-Count", fmt.Sprintf("%d", maxResults))
+ ctx.Header().Set("Access-Control-Expose-Headers", "X-Total-Count, Link")
ctx.JSON(http.StatusOK, &results)
}