summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbobemoe <inbox.github@jhodges.co.uk>2020-01-21 22:51:39 +0000
committertechknowlogick <techknowlogick@gitea.io>2020-01-21 17:51:39 -0500
commitcca13ae2acf1ef7a3b0516a8774dff0365b73697 (patch)
treed9a7d7ed88c4ce85e7fc2846803d7e77e3cbeedb
parent38a6b11015b64623d738e95e702ab7b1b3b6e71e (diff)
downloadgitea-cca13ae2acf1ef7a3b0516a8774dff0365b73697.tar.gz
gitea-cca13ae2acf1ef7a3b0516a8774dff0365b73697.zip
add remote ip to the invalid credentials error message (#9918)
-rw-r--r--routers/repo/http.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go
index d0a2b289b7..e0beba888e 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -198,14 +198,14 @@ func HTTP(ctx *context.Context) {
authUser, err = models.GetUserByName(authUsername)
if err != nil {
if models.IsErrUserNotExist(err) {
- ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
+ ctx.HandleText(http.StatusUnauthorized, fmt.Sprintf("invalid credentials from %s", ctx.RemoteAddr()))
} else {
ctx.ServerError("GetUserByName", err)
}
return
}
if authUser.ID != token.UID {
- ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
+ ctx.HandleText(http.StatusUnauthorized, fmt.Sprintf("invalid credentials from %s", ctx.RemoteAddr()))
return
}
}
@@ -231,7 +231,7 @@ func HTTP(ctx *context.Context) {
}
if authUser == nil {
- ctx.HandleText(http.StatusUnauthorized, "invalid credentials")
+ ctx.HandleText(http.StatusUnauthorized, fmt.Sprintf("invalid credentials from %s", ctx.RemoteAddr()))
return
}