From b5e7b254e4514d3fa7f5afd32e53c80f73c24b0d Mon Sep 17 00:00:00 2001 From: evilsocket Date: Fri, 12 Jan 2018 23:43:15 +0100 Subject: [PATCH] fix: added hostname in http.server logs --- modules/http_server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/http_server.go b/modules/http_server.go index 04e51fde..a6594fd0 100644 --- a/modules/http_server.go +++ b/modules/http_server.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net/http" + "strings" "time" "github.com/evilsocket/bettercap-ng/core" @@ -65,7 +66,7 @@ func (httpd *HttpServer) Author() string { func wrapHandler(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - log.Info("(%s) %s %s %s", core.Green("httpd"), core.Bold(r.RemoteAddr), r.Method, r.URL.Path) + log.Info("(%s) %s %s %s%s", core.Green("httpd"), core.Bold(strings.Split(r.RemoteAddr, ":")[0]), r.Method, r.Host, r.URL.Path) h.ServeHTTP(w, r) }) }