From dec4ad02be04c0052eaf0d1531fc09d95ec29b4c Mon Sep 17 00:00:00 2001 From: Min Kim Date: Fri, 5 Nov 2021 19:40:54 +0800 Subject: [PATCH] fixes duplicated slash (#18) --- .../typed/cluster/v1alpha1/clustergateway_expansion.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/clustergateway_expansion.go b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/clustergateway_expansion.go index c2e49a41..d98a8d41 100644 --- a/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/clustergateway_expansion.go +++ b/pkg/generated/clientset/versioned/typed/cluster/v1alpha1/clustergateway_expansion.go @@ -17,6 +17,7 @@ package v1alpha1 import ( "context" "net/http" + "strings" "k8s.io/client-go/transport" @@ -101,7 +102,10 @@ func (p gatewayAPIPrefixPrepender) RoundTrip(req *http.Request) (*http.Response, "/" + v1alpha1.SchemeGroupVersion.Version + "/clustergateways/" - fullPath := prefix + p.clusterNameGetter(req.Context()) + "/proxy/" + originalPath + if !strings.HasPrefix(originalPath, "/") { + originalPath = "/" + originalPath + } + fullPath := prefix + p.clusterNameGetter(req.Context()) + "/proxy" + originalPath req.URL.Path = fullPath return p.delegate.RoundTrip(req) }