fix server info bug

pull/972/head
longXboy 4 years ago
parent 149fc0195e
commit 63191930ed
  1. 2
      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 = transport.NewContext(ctx, transport.Transport{Kind: transport.KindHTTP})
ctx = NewServerContext(ctx, ServerInfo{Request: req, Response: res}) ctx = NewServerContext(ctx, ServerInfo{Request: req, Response: res})
if s.timeout > 0 { if s.timeout > 0 {
ctx, cancel = context.WithTimeout(req.Context(), s.timeout) ctx, cancel = context.WithTimeout(ctx, s.timeout)
defer cancel() defer cancel()
} }
s.router.ServeHTTP(res, req.WithContext(ctx)) s.router.ServeHTTP(res, req.WithContext(ctx))

Loading…
Cancel
Save