Skip to content

Commit 42916be

Browse files
committed
upgrade
1 parent 2a41b86 commit 42916be

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

caddy/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ
470470
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
471471
github.com/slackhq/nebula v1.9.6 h1:Fl0LE2dHDeVEK3R+un59Z3V4ZzbZ6q2e/zF4ClaD5yo=
472472
github.com/slackhq/nebula v1.9.6/go.mod h1:1+4q4wd3dDAjO8rKCttSb9JIVbklQhuJiBp5I0lbIsQ=
473+
github.com/slackhq/nebula v1.9.7 h1:v5u46efIyYHGdfjFnozQbRRhMdaB9Ma1SSTcUcE2lfE=
473474
github.com/slackhq/nebula v1.9.7/go.mod h1:1+4q4wd3dDAjO8rKCttSb9JIVbklQhuJiBp5I0lbIsQ=
474475
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262 h1:unQFBIznI+VYD1/1fApl1A+9VcBk+9dcqGfnePY87LY=
475476
github.com/smallstep/assert v0.0.0-20200723003110-82e2b9b3b262/go.mod h1:MyOHs9Po2fbM1LHej6sBUT8ozbxmMOFG+E+rx/GSGuc=

caddy/module.go

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff 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

300299
func (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.

0 commit comments

Comments
 (0)