mirror of
https://github.com/caddyserver/caddy.git
synced 2025-12-08 06:09:53 +00:00
caddyhttp: Fix logging on wildcard sites when SkipUnmappedHosts is true (#7372)
This commit is contained in:
parent
7ebe72bbfe
commit
be5f49fbeb
1 changed files with 5 additions and 3 deletions
|
|
@ -763,9 +763,11 @@ func (s *Server) shouldLogRequest(r *http.Request) bool {
|
||||||
hostWithoutPort = r.Host
|
hostWithoutPort = r.Host
|
||||||
}
|
}
|
||||||
|
|
||||||
if _, ok := s.Logs.LoggerNames[hostWithoutPort]; ok {
|
for loggerName := range s.Logs.LoggerNames {
|
||||||
// this host is mapped to a particular logger name
|
if certmagic.MatchWildcard(hostWithoutPort, loggerName) {
|
||||||
return true
|
// this host is mapped to a particular logger name
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for _, dh := range s.Logs.SkipHosts {
|
for _, dh := range s.Logs.SkipHosts {
|
||||||
// logging for this particular host is disabled
|
// logging for this particular host is disabled
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue