| Index: appengine/gaemiddleware/context.go
|
| diff --git a/appengine/gaemiddleware/context.go b/appengine/gaemiddleware/context.go
|
| index 60a8bce83791c2a309cd777a9bd2c7ade7e19373..b8da7cc1e39949972f6a8e418ddfb5ba121d76d2 100644
|
| --- a/appengine/gaemiddleware/context.go
|
| +++ b/appengine/gaemiddleware/context.go
|
| @@ -9,7 +9,6 @@ import (
|
|
|
| "google.golang.org/appengine"
|
|
|
| - "github.com/julienschmidt/httprouter"
|
| "golang.org/x/net/context"
|
|
|
| "github.com/luci/gae/filter/dscache"
|
| @@ -25,6 +24,7 @@ import (
|
| "github.com/luci/luci-go/server/auth"
|
| "github.com/luci/luci-go/server/middleware"
|
| "github.com/luci/luci-go/server/proccache"
|
| + "github.com/luci/luci-go/server/router"
|
| "github.com/luci/luci-go/server/settings"
|
| )
|
|
|
| @@ -78,12 +78,14 @@ func WithProd(c context.Context, req *http.Request) context.Context {
|
| //
|
| // It installs services using WithProd, installs a panic catcher if this
|
| // is not a devserver, and injects the monitoring middleware.
|
| -func BaseProd(h middleware.Handler) httprouter.Handle {
|
| - h = globalTsMonState.Middleware(h)
|
| +func BaseProd() []router.Handler {
|
| + var h []router.Handler
|
| + h = append(h, func(c *router.Context) {
|
| + c.Context = WithProd(context.Background(), c.Request)
|
| + })
|
| if !appengine.IsDevAppServer() {
|
| - h = middleware.WithPanicCatcher(h)
|
| - }
|
| - return func(rw http.ResponseWriter, r *http.Request, p httprouter.Params) {
|
| - h(WithProd(context.Background(), r), rw, r, p)
|
| + h = append(h, middleware.WithPanicCatcher())
|
| }
|
| + h = append(h, globalTsMonState.Middleware())
|
| + return h
|
| }
|
|
|