From 39c9de8e2ae9a8782ad0ce7d8ed5fd916c6ca4c1 Mon Sep 17 00:00:00 2001 From: Jonathan Lange Date: Wed, 15 Jun 2016 16:06:19 +0100 Subject: [PATCH] Get route name before munging request This ought to correct a problem where we incorrectly report route names for admin routes --- common/middleware/instrument.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/middleware/instrument.go b/common/middleware/instrument.go index 11744a10fa..ee545aaff2 100644 --- a/common/middleware/instrument.go +++ b/common/middleware/instrument.go @@ -30,9 +30,9 @@ func (i Instrument) Wrap(next http.Handler) http.Handler { begin := time.Now() isWS := strconv.FormatBool(isWSHandshakeRequest(r)) interceptor := &interceptor{ResponseWriter: w, statusCode: http.StatusOK} + route := i.getRouteName(r) next.ServeHTTP(interceptor, r) var ( - route = i.getRouteName(r) status = strconv.Itoa(interceptor.statusCode) took = time.Since(begin) )