From f8ec43dbc7ca10e456ddf0cf739d2f5035dea879 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 20 Nov 2021 15:33:18 +0000 Subject: 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 --- routers/api/v1/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers/api/v1/api.go') 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 { -- cgit v1.2.3