deduplicate registration-time duplicates from match directives,#2487
deduplicate registration-time duplicates from match directives,#2487henderkes wants to merge 1 commit into
match directives,#2487Conversation
462a8ba to
8dabdb4
Compare
|
I think the issue comes from |
|
Thinking about it again, cleanest option is probably a separate handler directive. Something like this: // in caddy.go:Init()
httpcaddyfile.RegisterHandlerDirective("php_without_provision", parseCaddyfileWithoutProvision)`// in module.go
func parseCaddyfileWithoutProvision(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) {
m := &FrankenPHPModule{ skipProvision:true }
err := m.UnmarshalCaddyfile(h.Dispenser)
return m, err
}
func (f *FrankenPHPModule) Provision(ctx caddy.Context) error {
if f.skipProvision {
return nil // this module should skip the provision step
}
// ...
} |
That would break worker serving on match paths, unless we were to still run the provision, but skip the registration logic. But at that point we still need a route group and it's complexity is the same as this. |
|
Hmm yeah. That makes me think we might finally need something like a |
|
I very much agree, but that's a larger change that'll inevitably dig up some other dirt. If you want to go for it now, we can close this one, otherwise we can add it as a longer-term goal. |
fixes #2477
it's a really bad workaround, but I can't think of a better way without a major rework for the
matchmatching logic