From c8fd650e9a4953677b7bfdeeb2a24715ae55bfb7 Mon Sep 17 00:00:00 2001 From: Sietse Ringers Date: Mon, 1 Jul 2019 13:18:42 +0200 Subject: [PATCH] fix: don't log HTTP protocol version (which is always 1.1) --- internal/servercore/api.go | 2 +- server/api.go | 5 +---- server/requestorserver/server.go | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/internal/servercore/api.go b/internal/servercore/api.go index 637b72c94..16f14c538 100644 --- a/internal/servercore/api.go +++ b/internal/servercore/api.go @@ -291,7 +291,7 @@ func (s *Server) HandleProtocolMessage( var start time.Time if s.conf.Verbose >= 2 { start = time.Now() - server.LogRequest("client", method, path, "", "", http.Header(headers), message) + server.LogRequest("client", method, path, "", http.Header(headers), message) } status, output, result := s.handleProtocolMessage(path, method, headers, message) diff --git a/server/api.go b/server/api.go index de6008ae7..2a92dc90d 100644 --- a/server/api.go +++ b/server/api.go @@ -397,7 +397,7 @@ func LogWarning(err error) error { return log(logrus.WarnLevel, err) } -func LogRequest(typ, method, url, proto, from string, headers http.Header, message []byte) { +func LogRequest(typ, method, url, from string, headers http.Header, message []byte) { fields := logrus.Fields{ "type": typ, "method": method, @@ -409,9 +409,6 @@ func LogRequest(typ, method, url, proto, from string, headers http.Header, messa if len(message) > 0 { fields["message"] = string(message) } - if proto != "" { - fields["proto"] = proto - } if from != "" { fields["from"] = from } diff --git a/server/requestorserver/server.go b/server/requestorserver/server.go index 6ac462740..c35c3aec7 100644 --- a/server/requestorserver/server.go +++ b/server/requestorserver/server.go @@ -236,7 +236,7 @@ func (s *Server) logHandler(typ string, logResponse, logHeaders, logFrom bool) f if logFrom { from = r.RemoteAddr } - server.LogRequest(typ, r.Method, r.URL.String(), r.Proto, from, headers, message) + server.LogRequest(typ, r.Method, r.URL.String(), from, headers, message) // copy output of HTTP handler to our buffer for later logging ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor)