diff --git a/caddy/module.go b/caddy/module.go index 21293cf2f1..cf7fa7a63f 100644 --- a/caddy/module.go +++ b/caddy/module.go @@ -331,18 +331,13 @@ const namedRouteServerIndexBase = 1 << 20 func (f *FrankenPHPModule) assignServerIndex(h httpcaddyfile.Helper) { counter, ok := h.State["php_server_count"].(int) - if !ok && inNamedRoute(h) { + if !ok && h.IsNamedRoute() { counter = namedRouteServerIndexBase } f.ServerIndex = counter + 1 h.State["php_server_count"] = counter + 1 } -// inNamedRoute relies on Caddy setting the named_routes option only once all named routes are adapted -func inNamedRoute(h httpcaddyfile.Helper) bool { - return h.Option("named_routes") == nil -} - // parseCaddyfile unmarshals tokens from h into a new Middleware. func parseCaddyfile(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) { m := &FrankenPHPModule{}