summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-29 14:44:38 +0800
committerUnknwon <u@gogs.io>2015-08-29 14:44:38 +0800
commit384fbeca801180c2f156e916bf69324590472e03 (patch)
tree2ffc0d2b109c11bb4e3c57f9a56992ee24bb6774
parent63799b3c18b2511f51ccb1a985391ede641e8e93 (diff)
downloadgitea-384fbeca801180c2f156e916bf69324590472e03.tar.gz
gitea-384fbeca801180c2f156e916bf69324590472e03.zip
#1474 logic fix
-rw-r--r--modules/avatar/avatar.go2
-rw-r--r--modules/middleware/auth.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go
index 52a9433dec..493f6d9310 100644
--- a/modules/avatar/avatar.go
+++ b/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
}
diff --git a/modules/middleware/auth.go b/modules/middleware/auth.go
index f607460037..68d74e8764 100644
--- a/modules/middleware/auth.go
+++ b/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
}
}