mirror of
https://github.com/go-kratos/kratos.git
synced 2025-03-17 21:07:54 +02:00
fix server info bug
This commit is contained in:
parent
149fc0195e
commit
63191930ed
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user