From 2a54aed1352cfb8b036ce6de4c4b105906f40923 Mon Sep 17 00:00:00 2001 From: yusing Date: Tue, 11 Feb 2025 09:49:49 +0800 Subject: [PATCH] fix incorrect RequestURI --- agent/pkg/handler/proxy_http.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/agent/pkg/handler/proxy_http.go b/agent/pkg/handler/proxy_http.go index 10cbb25..63f234b 100644 --- a/agent/pkg/handler/proxy_http.go +++ b/agent/pkg/handler/proxy_http.go @@ -47,9 +47,12 @@ func ProxyHTTP(w http.ResponseWriter, r *http.Request) { transport.ResponseHeaderTimeout = time.Duration(responseHeaderTimeout) * time.Second } - r.URL.Scheme = scheme - r.URL.Host = host + r.URL.Scheme = "" + r.URL.Host = "" r.URL.Path = r.URL.Path[agent.HTTPProxyURLStripLen:] // strip the {API_BASE}/proxy/http prefix + r.RequestURI = r.URL.String() + r.URL.Host = host + r.URL.Scheme = scheme logging.Debug().Msgf("proxy http request: %s %s", r.Method, r.URL.String())