mirror of
https://github.com/bettercap/bettercap
synced 2025-07-12 16:13:48 -07:00
fix: printing path for unauthorized attempts to request api.rest routes
This commit is contained in:
parent
09c09e647b
commit
d7b6cdb8a1
1 changed files with 1 additions and 1 deletions
|
@ -22,7 +22,7 @@ type APIResponse struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (mod *RestAPI) setAuthFailed(w http.ResponseWriter, r *http.Request) {
|
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.Header().Set("WWW-Authenticate", `Basic realm="auth"`)
|
||||||
w.WriteHeader(401)
|
w.WriteHeader(401)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue