From ce5732a7bff930cd5e3d67a4e8a95a0ffb51bd30 Mon Sep 17 00:00:00 2001 From: Stephan Renatus Date: Wed, 11 Oct 2017 21:10:42 +0200 Subject: [PATCH] runtime: use r.Context() (#473) Signed-off-by: Stephan Renatus --- runtime/mux.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/runtime/mux.go b/runtime/mux.go index f7a228031dc..205bc430921 100644 --- a/runtime/mux.go +++ b/runtime/mux.go @@ -146,8 +146,7 @@ func (s *ServeMux) Handle(meth string, pat Pattern, h HandlerFunc) { // ServeHTTP dispatches the request to the first handler whose pattern matches to r.Method and r.Path. func (s *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) { - // TODO: use r.Context for go 1.7+ - ctx := context.Background() + ctx := r.Context() path := r.URL.Path if !strings.HasPrefix(path, "/") {