Skip to content

Commit

Permalink
Merge pull request distribution#1744 from tonyhb/add-config-to-middle…
Browse files Browse the repository at this point in the history
…ware

Pass in `app` as context to apply{N}Middleware
  • Loading branch information
Richard Scothern committed May 25, 2016
2 parents 7f5c6dd + 166c4a9 commit 596ca8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions registry/handlers/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func NewApp(ctx context.Context, config *configuration.Configuration) *App {
}
}

app.registry, err = applyRegistryMiddleware(app.Context, app.registry, config.Middleware["registry"])
app.registry, err = applyRegistryMiddleware(app, app.registry, config.Middleware["registry"])
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -647,7 +647,7 @@ func (app *App) dispatcher(dispatch dispatchFunc) http.Handler {
repository,
app.eventBridge(context, r))

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

0 comments on commit 596ca8b

Please sign in to comment.