summaryrefslogtreecommitdiff
path: root/modules/caddyhttp
diff options
context:
space:
mode:
authorMatt Holt <mholt@users.noreply.github.com>2022-03-04 13:44:59 -0700
committerGitHub <noreply@github.com>2022-03-04 13:44:59 -0700
commit2bb8550a4cd59575ea7cc7c507550b9bd079894f (patch)
tree6b607691c1f86031eac113fea660333c4b02508d /modules/caddyhttp
parenta72acd21b0ef17d6cd9064dd105042b6edb3b8dc (diff)
caddyhttp: Honor wildcard hosts in log SkipHosts (#4606)
Diffstat (limited to 'modules/caddyhttp')
-rw-r--r--modules/caddyhttp/server.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/caddyhttp/server.go b/modules/caddyhttp/server.go
index fa153cd..3d21184 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
}
}