summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--caddyconfig/httpcaddyfile/httptype.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/caddyconfig/httpcaddyfile/httptype.go b/caddyconfig/httpcaddyfile/httptype.go
index 42fee71..7bb7c56 100644
--- a/caddyconfig/httpcaddyfile/httptype.go
+++ b/caddyconfig/httpcaddyfile/httptype.go
@@ -465,6 +465,20 @@ func (st *ServerType) serversFromPairings(
(addr.Port == httpsPort || (addr.Port != httpPort && addr.Host != ""))
}
+ // Look for any config values that provide listener wrappers on the server block
+ for _, listenerConfig := range sblock.pile["listener_wrapper"] {
+ listenerWrapper, ok := listenerConfig.Value.(caddy.ListenerWrapper)
+ if !ok {
+ return nil, fmt.Errorf("config for a listener wrapper did not provide a value that implements caddy.ListenerWrapper")
+ }
+ jsonListenerWrapper := caddyconfig.JSONModuleObject(
+ listenerWrapper,
+ "wrapper",
+ listenerWrapper.(caddy.Module).CaddyModule().ID.Name(),
+ warnings)
+ srv.ListenerWrappersRaw = append(srv.ListenerWrappersRaw, jsonListenerWrapper)
+ }
+
// set up each handler directive, making sure to honor directive order
dirRoutes := sblock.pile["route"]
siteSubroute, err := buildSubroute(dirRoutes, groupCounter)