aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2021-10-16 11:34:07 +0800
committerGitHub <noreply@github.com>2021-10-15 23:34:07 -0400
commite18ea9e3491e872d0a0736322ace4def5680432c (patch)
tree31fe00ae5331ffc5b0553795efda9a03b5ab5916 /routers/api
parent55885297f471603de6212917a47ceb2078a449d1 (diff)
downloadgitea-e18ea9e3491e872d0a0736322ace4def5680432c.tar.gz
gitea-e18ea9e3491e872d0a0736322ace4def5680432c.zip
Update documents for Gitea behind reverse proxy. Fix some small bugs (some URLs are generated without sub-path) (#17320)
* Apache `ProxyPassReverse` only works for Location, Content-Location and URI headers on HTTP redirect responses, it causes more problems than it resolves. Now all URLs generated by Gitee have the correct prefix AppSubURL. We do not need to set `ProxyPassReverse`. * fix url param * use AppSubURL instead of AppURL in api/v1 Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'routers/api')
-rw-r--r--routers/api/v1/api.go2
-rw-r--r--routers/api/v1/org/member.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index d11bbf3c06..d915b76f78 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -576,7 +576,7 @@ func Routes(sessioner func(http.Handler) http.Handler) *web.Route {
// Miscellaneous
if setting.API.EnableSwagger {
m.Get("/swagger", func(ctx *context.APIContext) {
- ctx.Redirect("/api/swagger")
+ ctx.Redirect(setting.AppSubURL + "/api/swagger")
})
}
m.Get("/version", misc.Version)
diff --git a/routers/api/v1/org/member.go b/routers/api/v1/org/member.go
index 97940d5925..a6f140c38f 100644
--- a/routers/api/v1/org/member.go
+++ b/routers/api/v1/org/member.go
@@ -159,7 +159,7 @@ func IsMember(ctx *context.APIContext) {
}
}
- redirectURL := setting.AppURL + "api/v1/orgs/" + ctx.Org.Organization.Name + "/public_members/" + userToCheck.Name
+ redirectURL := setting.AppSubURL + "/api/v1/orgs/" + ctx.Org.Organization.Name + "/public_members/" + userToCheck.Name
ctx.Redirect(redirectURL, 302)
}