Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions caddy/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
Loading