From 63191930edff65a01d8bfcfc33f0e82032aac319 Mon Sep 17 00:00:00 2001 From: longXboy Date: Sun, 30 May 2021 21:43:41 +0800 Subject: [PATCH] fix server info bug --- transport/http/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/http/server.go b/transport/http/server.go index 358d5245e..9a41bf5ce 100644 --- a/transport/http/server.go +++ b/transport/http/server.go @@ -101,7 +101,7 @@ func (s *Server) ServeHTTP(res http.ResponseWriter, req *http.Request) { ctx = transport.NewContext(ctx, transport.Transport{Kind: transport.KindHTTP}) ctx = NewServerContext(ctx, ServerInfo{Request: req, Response: res}) if s.timeout > 0 { - ctx, cancel = context.WithTimeout(req.Context(), s.timeout) + ctx, cancel = context.WithTimeout(ctx, s.timeout) defer cancel() } s.router.ServeHTTP(res, req.WithContext(ctx))