File tree Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Expand file tree Collapse file tree 2 files changed +4
-19
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,7 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
470470github.com/sirupsen/logrus v1.9.3 /go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ =
471471github.com/slackhq/nebula v1.9.6 h1:Fl0LE2dHDeVEK3R+un59Z3V4ZzbZ6q2e/zF4ClaD5yo =
472472github.com/slackhq/nebula v1.9.6 /go.mod h1:1+4q4wd3dDAjO8rKCttSb9JIVbklQhuJiBp5I0lbIsQ =
473+ github.com/slackhq/nebula v1.9.7 h1:v5u46efIyYHGdfjFnozQbRRhMdaB9Ma1SSTcUcE2lfE =
473474github.com/slackhq/nebula v1.9.7 /go.mod h1:1+4q4wd3dDAjO8rKCttSb9JIVbklQhuJiBp5I0lbIsQ =
474475github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY =
475476github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 /go.mod h1:MyOHs9Po2fbM1LHej6sBUT8ozbxmMOFG+E+rx/GSGuc =
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ import (
1919 "github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite"
2020 "github.com/dunglas/frankenphp"
2121 "github.com/dunglas/frankenphp/internal/fastabs"
22- "github.com/dunglas/mercure"
2322 mercureCaddy "github.com/dunglas/mercure/caddy"
2423)
2524
@@ -298,25 +297,10 @@ func (f *FrankenPHPModule) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
298297}
299298
300299func (f * FrankenPHPModule ) assignMercureHubRequestOption (ctx caddy.Context ) {
301- var hub * mercure.Hub
302- for _ , m := range ctx .Modules () {
303- if h , ok := mercureCaddy .Hubs [m ]; ok {
304- hub = h
305-
306- break
307- }
308- }
309-
310- if h , ok := mercureCaddy .Hubs [nil ]; ok {
311- hub = h
312- }
313-
314- if hub == nil {
315- return
300+ if hub := mercureCaddy .FindHub (ctx .Modules ()); hub != nil {
301+ opt := frankenphp .WithMercureHub (hub )
302+ f .mercureHubRequestOption = & opt
316303 }
317-
318- opt := frankenphp .WithMercureHub (hub )
319- f .mercureHubRequestOption = & opt
320304}
321305
322306// parseCaddyfile unmarshals tokens from h into a new Middleware.
You can’t perform that action at this time.
0 commit comments