mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 12:24:38 +03:00
do not generate http status 502 for canceled http requests
do log them with level debug, and print the error in the http access log line.
This commit is contained in:
@ -152,7 +152,11 @@ func (w *loggingWriter) Done() {
|
||||
tlsinfo = "(other)"
|
||||
}
|
||||
}
|
||||
xlog.WithContext(w.R.Context()).Debugx("http request", w.WriteErr,
|
||||
err := w.WriteErr
|
||||
if err == nil {
|
||||
err = w.R.Context().Err()
|
||||
}
|
||||
xlog.WithContext(w.R.Context()).Debugx("http request", err,
|
||||
mlog.Field("httpaccess", ""),
|
||||
mlog.Field("handler", w.Handler),
|
||||
mlog.Field("method", method),
|
||||
|
Reference in New Issue
Block a user