Commit e673337c by Mario Trangoni

pkg/middleware/middleware.go: Fix empty branch warning.

See,
$ gometalinter --vendor --deadline 10m --disable-all --enable=megacheck ./...
pkg/middleware/middleware.go:46:3:warning: empty branch (SA9003) (megacheck)
parent abb6b135
...@@ -43,12 +43,13 @@ func GetContextHandler() macaron.Handler { ...@@ -43,12 +43,13 @@ func GetContextHandler() macaron.Handler {
// then init session and look for userId in session // then init session and look for userId in session
// then look for api key in session (special case for render calls via api) // then look for api key in session (special case for render calls via api)
// then test if anonymous access is enabled // then test if anonymous access is enabled
if initContextWithRenderAuth(ctx) || switch {
initContextWithApiKey(ctx) || case initContextWithRenderAuth(ctx):
initContextWithBasicAuth(ctx, orgId) || case initContextWithApiKey(ctx):
initContextWithAuthProxy(ctx, orgId) || case initContextWithBasicAuth(ctx, orgId):
initContextWithUserSessionCookie(ctx, orgId) || case initContextWithAuthProxy(ctx, orgId):
initContextWithAnonymousUser(ctx) { case initContextWithUserSessionCookie(ctx, orgId):
case initContextWithAnonymousUser(ctx):
} }
ctx.Logger = log.New("context", "userId", ctx.UserId, "orgId", ctx.OrgId, "uname", ctx.Login) ctx.Logger = log.New("context", "userId", ctx.UserId, "orgId", ctx.OrgId, "uname", ctx.Login)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment