aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/http.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 1c3453a3a9..5b469754ad 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -83,12 +83,8 @@ func HTTP(ctx *context.Context) {
// check access
if askAuth {
- if setting.Service.EnableReverseProxyAuth {
- authUsername = ctx.Req.Header.Get(setting.ReverseProxyAuthUser)
- if len(authUsername) == 0 {
- ctx.HandleText(401, "reverse proxy login error. authUsername empty")
- return
- }
+ authUsername = ctx.Req.Header.Get(setting.ReverseProxyAuthUser)
+ if setting.Service.EnableReverseProxyAuth && len(authUsername) > 0 {
authUser, err = models.GetUserByName(authUsername)
if err != nil {
ctx.HandleText(401, "reverse proxy login error, got error while running GetUserByName")