Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
Mirrored from https://github.com/Slazee/caddy.git
Synced Nov 14, 05:15 UTC
caddyhttp: Fix nil pointer dereference
Matthew Holt committed
Oct 29, 2019 at 00:08 UTC
d803561212a81f71509356cfcb276879d55ebf4f
1 file changed
+1
-1
modules/caddyhttp/server.go
+1
-1
@@ -136,7 +136,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
136
if err != nil {
137
// prepare the error log
138
logger := errLog
139
- if s.Logs.LoggerNames != nil {
139
+ if s.Logs != nil && s.Logs.LoggerNames != nil {
140
logger = logger.Named(s.Logs.LoggerNames[r.Host])
141
}
142