Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 12, 03:15 UTC
Revert "logging: Always set fields func; fix #6829"
This reverts commit 932dac157a3c4693b80576477498bb86208b9b30. Somehow the code I was looking at changed when I committed, without realizing it. This has already been fixed in #6777.
Matthew Holt committed
Feb 7, 2025 at 06:23 UTC
9b74a53e510d395e0cbe617a29db6de9828388b8
2 files changed
-2
modules/caddyhttp/logging.go
-1
@@ -195,7 +195,6 @@ func (sa *StringArray) UnmarshalJSON(b []byte) error {
195
// have richer information.
196
func errLogValues(err error) (status int, msg string, fields func() []zapcore.Field) {
197
var handlerErr HandlerError
198
- fields = func() []zapcore.Field { return []zapcore.Field{} } // don't be nil (fix #6829)
198
if errors.As(err, &handlerErr) {
199
status = handlerErr.StatusCode
200
if handlerErr.Err == nil {
modules/caddyhttp/server.go
-1
@@ -408,7 +408,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
408
if fields == nil {
409
fields = errFields()
410
}
411
-
411
c.Write(fields...)
412
}
413
}