Skip to content

Commit dec4ad0

Browse files
authored
fixes duplicated slash (#18)
1 parent 4d1ea02 commit dec4ad0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/generated/clientset/versioned/typed/cluster/v1alpha1/clustergateway_expansion.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package v1alpha1
1717
import (
1818
"context"
1919
"net/http"
20+
"strings"
2021

2122
"k8s.io/client-go/transport"
2223

@@ -101,7 +102,10 @@ func (p gatewayAPIPrefixPrepender) RoundTrip(req *http.Request) (*http.Response,
101102
"/" +
102103
v1alpha1.SchemeGroupVersion.Version +
103104
"/clustergateways/"
104-
fullPath := prefix + p.clusterNameGetter(req.Context()) + "/proxy/" + originalPath
105+
if !strings.HasPrefix(originalPath, "/") {
106+
originalPath = "/" + originalPath
107+
}
108+
fullPath := prefix + p.clusterNameGetter(req.Context()) + "/proxy" + originalPath
105109
req.URL.Path = fullPath
106110
return p.delegate.RoundTrip(req)
107111
}

0 commit comments

Comments
 (0)