Skip to content

Commit 596ca8b

Browse files
author
Richard Scothern
committed
Merge pull request distribution#1744 from tonyhb/add-config-to-middleware
Pass in `app` as context to apply{N}Middleware
2 parents 7f5c6dd + 166c4a9 commit 596ca8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

registry/handlers/app.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func NewApp(ctx context.Context, config *configuration.Configuration) *App {
258258
}
259259
}
260260

261-
app.registry, err = applyRegistryMiddleware(app.Context, app.registry, config.Middleware["registry"])
261+
app.registry, err = applyRegistryMiddleware(app, app.registry, config.Middleware["registry"])
262262
if err != nil {
263263
panic(err)
264264
}
@@ -647,7 +647,7 @@ func (app *App) dispatcher(dispatch dispatchFunc) http.Handler {
647647
repository,
648648
app.eventBridge(context, r))
649649

650-
context.Repository, err = applyRepoMiddleware(context.Context, context.Repository, app.Config.Middleware["repository"])
650+
context.Repository, err = applyRepoMiddleware(app, context.Repository, app.Config.Middleware["repository"])
651651
if err != nil {
652652
ctxu.GetLogger(context).Errorf("error initializing repository middleware: %v", err)
653653
context.Errors = append(context.Errors, errcode.ErrorCodeUnknown.WithDetail(err))

0 commit comments

Comments
 (0)