mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-07 06:59:59 +08:00
fix(gateway): fixed http gateway context propagation error (#4634)
This commit is contained in:
@@ -190,6 +190,8 @@ func (s *Server) buildHttpHandler(target *HttpClientConf) http.HandlerFunc {
|
||||
ctx, cancel := context.WithTimeout(r.Context(), timeout)
|
||||
defer cancel()
|
||||
req = req.WithContext(ctx)
|
||||
} else {
|
||||
req = req.WithContext(r.Context())
|
||||
}
|
||||
|
||||
resp, err := httpc.DoRequest(req)
|
||||
|
||||
Reference in New Issue
Block a user