@marcel91200 / caddy Mirror · read-only / commits / 932dac15
Fork 0

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

logging: Always set fields func; fix #6829

Matthew Holt committed Feb 7, 2025 at 06:18 UTC 932dac157a3c4693b80576477498bb86208b9b30
1 file changed +1
modules/caddyhttp/logging.go
+1
@@ -195,6 +195,7 @@ 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)
199 if errors.As(err, &handlerErr) {
200 status = handlerErr.StatusCode
201 if handlerErr.Err == nil {