mirror of
https://github.com/bettercap/bettercap
synced 2025-07-16 10:03:39 -07:00
fix: printing ip addresses for unauthorized accesses
This commit is contained in:
parent
e36bcacf00
commit
626b81cec8
1 changed files with 1 additions and 1 deletions
|
@ -17,7 +17,7 @@ func (api *RestAPI) setupRoutes() {
|
||||||
|
|
||||||
func (api RestAPI) checkAuth(w http.ResponseWriter, r *http.Request) bool {
|
func (api RestAPI) checkAuth(w http.ResponseWriter, r *http.Request) bool {
|
||||||
if api.Authenticated(w, r) == false {
|
if api.Authenticated(w, r) == false {
|
||||||
log.Warning("Unauthenticated access!")
|
log.Warning("Unauthorized request from %s", strings.SplitN(r.RemoteAddr, ":", 2)[0])
|
||||||
http.Error(w, "Not authorized", 401)
|
http.Error(w, "Not authorized", 401)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue