| Index: appengine/logdog/coordinator/config/middleware.go
|
| diff --git a/appengine/logdog/coordinator/config/middleware.go b/appengine/logdog/coordinator/config/middleware.go
|
| index bef79ceb81eb25e0a01bd82e23f4f04587b2c900..de73495a95c4f700a70dfb9d6a1440ad95e1443b 100644
|
| --- a/appengine/logdog/coordinator/config/middleware.go
|
| +++ b/appengine/logdog/coordinator/config/middleware.go
|
| @@ -1,28 +1,23 @@
|
| // Copyright 2015 The LUCI Authors. All rights reserved.
|
| // Use of this source code is governed under the Apache License, Version 2.0
|
| // that can be found in the LICENSE file.
|
|
|
| package config
|
|
|
| import (
|
| "net/http"
|
|
|
| - "github.com/julienschmidt/httprouter"
|
| log "github.com/luci/luci-go/common/logging"
|
| - "github.com/luci/luci-go/server/middleware"
|
| - "golang.org/x/net/context"
|
| + "github.com/luci/luci-go/server/router"
|
| )
|
|
|
| -// WithConfig is a middleware.Handler that installs the LogDog Coordinator
|
| +// WithConfig is a middleware that installs the LogDog Coordinator
|
| // configuration into the Context.
|
| -func WithConfig(h middleware.Handler) middleware.Handler {
|
| - return func(c context.Context, rw http.ResponseWriter, r *http.Request, params httprouter.Params) {
|
| - if err := UseConfig(&c); err != nil {
|
| - log.WithError(err).Errorf(c, "Failed to install service configuration.")
|
| -
|
| - rw.WriteHeader(http.StatusInternalServerError)
|
| - return
|
| - }
|
| - h(c, rw, r, params)
|
| +func WithConfig(c *router.Context, next router.Handler) {
|
| + if err := UseConfig(&c.Context); err != nil {
|
| + log.WithError(err).Errorf(c.Context, "Failed to install service configuration.")
|
| + c.Writer.WriteHeader(http.StatusInternalServerError)
|
| + return
|
| }
|
| + next(c)
|
| }
|
|
|