Unknwon 9 years ago
parent
commit
384fbeca80
2 changed files with 3 additions and 3 deletions
  1. 1 1
      modules/avatar/avatar.go
  2. 2 2
      modules/middleware/auth.go

+ 1 - 1
modules/avatar/avatar.go

@@ -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
 	}

+ 2 - 2
modules/middleware/auth.go

@@ -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
 		}
 	}