Skip to content

Commit

Permalink
fix(platform): trim prefix in not found proxy (#1696)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoryu authored Dec 3, 2021
1 parent f17fd6a commit 3d9251f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"net/http"
"net/http/httputil"
"net/url"
"strings"
"time"

apierrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -123,7 +124,8 @@ func (n *CustomResourceHandler) ServeHTTP(w http.ResponseWriter, r *http.Request

reserveProxy := httputil.NewSingleHostReverseProxy(&url.URL{
Scheme: "https",
Host: config.Host,
// TODO: support apiserver with path
Host: strings.TrimPrefix(config.Host, "https://"),
})
reserveProxy.Transport = &http.Transport{
DialContext: (&net.Dialer{
Expand Down

0 comments on commit 3d9251f

Please sign in to comment.