From 513cf5af78906bd66acf22e8b65a709f6ebebec0 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 1 Mar 2022 14:05:09 -0700 Subject: [PATCH] caddyhttp: Honor wildcard hosts in log SkipHosts --- modules/caddyhttp/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go index fa153cd2229..3d2118469a6 100644 --- a/modules/caddyhttp/server.go +++ b/modules/caddyhttp/server.go @@ -27,6 +27,7 @@ import ( "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/modules/caddytls" + "github.com/caddyserver/certmagic" "github.com/lucas-clemente/quic-go/http3" "go.uber.org/zap" "go.uber.org/zap/zapcore" @@ -484,7 +485,7 @@ func (s *Server) shouldLogRequest(r *http.Request) bool { } for _, dh := range s.Logs.SkipHosts { // logging for this particular host is disabled - if r.Host == dh { + if certmagic.MatchWildcard(r.Host, dh) { return false } }