From ca805edfe0988fdb4d85d63673118e4c777f9b6d Mon Sep 17 00:00:00 2001 From: yusing Date: Wed, 17 Sep 2025 14:03:35 +0800 Subject: [PATCH] fix(agent): incorrect uri in reverse proxy --- agent/pkg/agent/http_requests.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/agent/pkg/agent/http_requests.go b/agent/pkg/agent/http_requests.go index ba0d9693..fa3b88bb 100644 --- a/agent/pkg/agent/http_requests.go +++ b/agent/pkg/agent/http_requests.go @@ -19,7 +19,6 @@ func (cfg *AgentConfig) Do(ctx context.Context, method, endpoint string, body io } func (cfg *AgentConfig) Forward(req *http.Request, endpoint string) (*http.Response, error) { - req = req.WithContext(req.Context()) req.URL.Host = AgentHost req.URL.Scheme = "https" req.URL.Path = APIEndpointBase + endpoint @@ -58,7 +57,7 @@ func (cfg *AgentConfig) Websocket(ctx context.Context, endpoint string) (*websoc // If the request has a query, it will be added to the proxy request's URL func (cfg *AgentConfig) ReverseProxy(w http.ResponseWriter, req *http.Request, endpoint string) error { rp := reverseproxy.NewReverseProxy("agent", nettypes.NewURL(AgentURL), cfg.Transport()) - uri := APIEndpointBase + endpoint + uri := endpoint if req.URL.RawQuery != "" { uri += "?" + req.URL.RawQuery }