summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-11-20 15:33:18 +0000
committerGitHub <noreply@github.com>2021-11-20 23:33:18 +0800
commitf8ec43dbc7ca10e456ddf0cf739d2f5035dea879 (patch)
tree029cfc4033b421993bf433b0c34afba4f885587d /routers/api/v1/api.go
parent931d0cf854afc06a4d3d3dc3277d2f383efd3423 (diff)
downloadgitea-f8ec43dbc7ca10e456ddf0cf739d2f5035dea879.tar.gz
gitea-f8ec43dbc7ca10e456ddf0cf739d2f5035dea879.zip
Extract constant names out for the ReverseProxy and Basic authentication methods (#17735)
In order to reduce load on the GC extract out the constant names of the Basic and ReverseProxy methods. As mentioned in https://github.com/go-gitea/gitea/pull/15119#discussion_r730352176 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 67f88cf000..099559caad 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -217,7 +217,7 @@ func reqExploreSignIn() func(ctx *context.APIContext) {
func reqBasicOrRevProxyAuth() func(ctx *context.APIContext) {
return func(ctx *context.APIContext) {
- if ctx.IsSigned && setting.Service.EnableReverseProxyAuth && ctx.Data["AuthedMethod"].(string) == new(auth.ReverseProxy).Name() {
+ if ctx.IsSigned && setting.Service.EnableReverseProxyAuth && ctx.Data["AuthedMethod"].(string) == auth.ReverseProxyMethodName {
return
}
if !ctx.Context.IsBasicAuth {