From 69a9451611c9192a5db70c6ef2fdca16dba830be Mon Sep 17 00:00:00 2001 From: patrickdtli Date: Fri, 8 Nov 2024 17:18:21 +0800 Subject: [PATCH] fix: crd proxy path --- .../registry/cluster/storage/customresource_proxy.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/platform/registry/cluster/storage/customresource_proxy.go b/pkg/platform/registry/cluster/storage/customresource_proxy.go index 709c498fc..2196b2100 100644 --- a/pkg/platform/registry/cluster/storage/customresource_proxy.go +++ b/pkg/platform/registry/cluster/storage/customresource_proxy.go @@ -156,11 +156,7 @@ func buildDirector(r *http.Request, config *rest.Config) func(req *http.Request) if config.BearerToken != "" { req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", config.BearerToken)) } - req.URL = &url.URL{ - Scheme: "https", - // TODO: support apiserver with path - Host: strings.TrimPrefix(config.Host, "https://"), - Path: r.RequestURI, - } + req.URL.Scheme = "https" + req.URL.Host = strings.TrimPrefix(config.Host, "https://") } }