Commit c8fd650e authored by Sietse Ringers's avatar Sietse Ringers
Browse files

fix: don't log HTTP protocol version (which is always 1.1)

parent 4e1ee035
...@@ -291,7 +291,7 @@ func (s *Server) HandleProtocolMessage( ...@@ -291,7 +291,7 @@ func (s *Server) HandleProtocolMessage(
var start time.Time var start time.Time
if s.conf.Verbose >= 2 { if s.conf.Verbose >= 2 {
start = time.Now() 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) status, output, result := s.handleProtocolMessage(path, method, headers, message)
......
...@@ -397,7 +397,7 @@ func LogWarning(err error) error { ...@@ -397,7 +397,7 @@ func LogWarning(err error) error {
return log(logrus.WarnLevel, err) 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{ fields := logrus.Fields{
"type": typ, "type": typ,
"method": method, "method": method,
...@@ -409,9 +409,6 @@ func LogRequest(typ, method, url, proto, from string, headers http.Header, messa ...@@ -409,9 +409,6 @@ func LogRequest(typ, method, url, proto, from string, headers http.Header, messa
if len(message) > 0 { if len(message) > 0 {
fields["message"] = string(message) fields["message"] = string(message)
} }
if proto != "" {
fields["proto"] = proto
}
if from != "" { if from != "" {
fields["from"] = from fields["from"] = from
} }
......
...@@ -236,7 +236,7 @@ func (s *Server) logHandler(typ string, logResponse, logHeaders, logFrom bool) f ...@@ -236,7 +236,7 @@ func (s *Server) logHandler(typ string, logResponse, logHeaders, logFrom bool) f
if logFrom { if logFrom {
from = r.RemoteAddr 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 // copy output of HTTP handler to our buffer for later logging
ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor) ww := middleware.NewWrapResponseWriter(w, r.ProtoMajor)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment