Skip to content

Commit

Permalink
fix: don't log HTTP protocol version (which is always 1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
sietseringers committed Jul 1, 2019
1 parent 4e1ee03 commit c8fd650
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/servercore/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions server/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion server/requestorserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c8fd650

Please sign in to comment.