feat(httpproxy): log credentials sent on mismatch
This commit is contained in:
@@ -2,6 +2,7 @@ package httpproxy
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
@@ -32,7 +33,8 @@ func (h *handler) isAuthorized(responseWriter http.ResponseWriter, request *http
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if h.username != usernamePassword[0] || h.password != usernamePassword[1] {
|
if h.username != usernamePassword[0] || h.password != usernamePassword[1] {
|
||||||
h.logger.Info("Username or password mismatch from " + request.RemoteAddr)
|
h.logger.Info(fmt.Sprintf("Username (%q) or password (%q) mismatch from %s",
|
||||||
|
usernamePassword[0], usernamePassword[1], request.RemoteAddr))
|
||||||
h.logger.Debug("username provided \"" + usernamePassword[0] +
|
h.logger.Debug("username provided \"" + usernamePassword[0] +
|
||||||
"\" and password provided \"" + usernamePassword[1] + "\"")
|
"\" and password provided \"" + usernamePassword[1] + "\"")
|
||||||
responseWriter.WriteHeader(http.StatusUnauthorized)
|
responseWriter.WriteHeader(http.StatusUnauthorized)
|
||||||
|
|||||||
Reference in New Issue
Block a user