mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-15 02:40:01 +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)
|
ctx, cancel := context.WithTimeout(r.Context(), timeout)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
req = req.WithContext(ctx)
|
req = req.WithContext(ctx)
|
||||||
|
} else {
|
||||||
|
req = req.WithContext(r.Context())
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := httpc.DoRequest(req)
|
resp, err := httpc.DoRequest(req)
|
||||||
|
|||||||
Reference in New Issue
Block a user