]> source.dussan.org Git - gitea.git/commitdiff
#1474 logic fix
authorUnknwon <u@gogs.io>
Sat, 29 Aug 2015 06:44:38 +0000 (14:44 +0800)
committerUnknwon <u@gogs.io>
Sat, 29 Aug 2015 06:44:38 +0000 (14:44 +0800)
modules/avatar/avatar.go
modules/middleware/auth.go

index 52a9433dec66121812c56f77783ab51f7e897a74..493f6d931046964a22c0925618644790d0132c7b 100644 (file)
@@ -45,7 +45,7 @@ func UpdateGravatarSource() {
        gravatarSource = setting.GravatarSource
        if strings.HasPrefix(gravatarSource, "//") {
                gravatarSource = "http:" + gravatarSource
-       } else if !strings.HasPrefix(gravatarSource, "http://") ||
+       } else if !strings.HasPrefix(gravatarSource, "http://") &&
                !strings.HasPrefix(gravatarSource, "https://") {
                gravatarSource = "http://" + gravatarSource
        }
index f607460037aa9f4f2b800fc6c9bbf89becfef590..68d74e8764e567ba233b116e6b6a0089bc297b2a 100644 (file)
@@ -119,7 +119,7 @@ func Toggle(options *ToggleOptions) macaron.Handler {
 func ApiReqToken() macaron.Handler {
        return func(ctx *Context) {
                if !ctx.IsSigned {
-                       ctx.Error(403)
+                       ctx.Error(401)
                        return
                }
        }
@@ -128,7 +128,7 @@ func ApiReqToken() macaron.Handler {
 func ApiReqBasicAuth() macaron.Handler {
        return func(ctx *Context) {
                if !ctx.IsBasicAuth {
-                       ctx.Error(403)
+                       ctx.Error(401)
                        return
                }
        }