From 72225de4ec5a6120a705540fd74e096789bebd4c Mon Sep 17 00:00:00 2001 From: Adam Fisk Date: Tue, 10 Dec 2024 10:02:23 -0700 Subject: [PATCH] hotfix for cloning http request context --- fronted.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fronted.go b/fronted.go index da2799a..2082fd7 100644 --- a/fronted.go +++ b/fronted.go @@ -608,7 +608,7 @@ func (ddf *directTransport) RoundTrip(req *http.Request) (resp *http.Response, e func cloneRequestWith(req *http.Request, frontedHost string, body io.ReadCloser) (*http.Request, error) { url := *req.URL url.Host = frontedHost - r, err := http.NewRequest(req.Method, url.String(), body) + r, err := http.NewRequestWithContext(req.Context(), req.Method, url.String(), body) if err != nil { return nil, err }