Skip to content

Commit

Permalink
fixes duplicated slash (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
yue9944882 authored Nov 5, 2021
1 parent 4d1ea02 commit dec4ad0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ package v1alpha1
import (
"context"
"net/http"
"strings"

"k8s.io/client-go/transport"

Expand Down Expand Up @@ -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)
}

0 comments on commit dec4ad0

Please sign in to comment.