From 91860db29baf11bb11c5e4b9cfaf157087922a7c Mon Sep 17 00:00:00 2001 From: AlanViast Date: Mon, 28 Oct 2024 17:30:01 +0800 Subject: [PATCH] fix: the path includes the root directory --- pkg/filters/proxies/providerproxy/providerproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/filters/proxies/providerproxy/providerproxy.go b/pkg/filters/proxies/providerproxy/providerproxy.go index 8faea8cd73..174aaf353b 100644 --- a/pkg/filters/proxies/providerproxy/providerproxy.go +++ b/pkg/filters/proxies/providerproxy/providerproxy.go @@ -102,7 +102,7 @@ func (m *ProviderProxy) ParsePayloadMethod(payload []byte) []string { } func (m *ProviderProxy) HandleRequest(req *httpprot.Request, providerUrl *url.URL) (forwardReq *http.Request, method []string, err error) { - if len(req.URL().Path) != 0 { + if len(req.URL().Path) != 0 && req.URL().Path != "/" { providerUrl = providerUrl.JoinPath(req.URL().Path) method = []string{req.URL().Path} } else {