@marcel91200 / caddy Mirror · read-only / commits / be5f49fb
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 11, 18:30 UTC

caddyhttp: Fix logging on wildcard sites when SkipUnmappedHosts is true (#7372)

Francis Lavoie committed Dec 3, 2025 at 13:46 UTC be5f49fbeb046fb123583e5887ddf576a312a8e4
1 file changed +5 -3
modules/caddyhttp/server.go
+5 -3
@@ -763,9 +763,11 @@ func (s *Server) shouldLogRequest(r *http.Request) bool {
763 hostWithoutPort = r.Host
764 }
765
766 - if _, ok := s.Logs.LoggerNames[hostWithoutPort]; ok {
767 - // this host is mapped to a particular logger name
768 - return true
766 + for loggerName := range s.Logs.LoggerNames {
767 + if certmagic.MatchWildcard(hostWithoutPort, loggerName) {
768 + // this host is mapped to a particular logger name
769 + return true
770 + }
771 }
772 for _, dh := range s.Logs.SkipHosts {
773 // logging for this particular host is disabled