fix: printing path for unauthorized attempts to request api.rest routes

This commit is contained in:
evilsocket 2019-03-19 00:40:28 +01:00
parent 09c09e647b
commit d7b6cdb8a1
No known key found for this signature in database
GPG key ID: 1564D7F30393A456

View file

@ -22,7 +22,7 @@ type APIResponse struct {
}
func (mod *RestAPI) setAuthFailed(w http.ResponseWriter, r *http.Request) {
mod.Warning("Unauthorized authentication attempt from %s", r.RemoteAddr)
mod.Warning("Unauthorized authentication attempt from %s to %s", r.RemoteAddr, r.URL.String())
w.Header().Set("WWW-Authenticate", `Basic realm="auth"`)
w.WriteHeader(401)