Plugins: Preserve trailing slash in plugin proxy (#86859)
* Plugins: Preserve trailing slash in plugin proxy * enable toggle by default
This commit is contained in:
committed by
GitHub
parent
17f03882d4
commit
fe3e5917f1
@@ -6,6 +6,7 @@ import (
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"go.opentelemetry.io/otel/attribute"
|
||||
|
||||
@@ -76,7 +77,12 @@ func (proxy *PluginProxy) HandleRequest() {
|
||||
}
|
||||
|
||||
if path, exists := params["*"]; exists {
|
||||
hasSlash := strings.HasSuffix(proxy.proxyPath, "/")
|
||||
proxy.proxyPath = path
|
||||
|
||||
if hasSlash && !strings.HasSuffix(path, "/") && proxy.features.IsEnabled(proxy.ctx.Req.Context(), featuremgmt.FlagPluginProxyPreserveTrailingSlash) {
|
||||
proxy.proxyPath += "/"
|
||||
}
|
||||
} else {
|
||||
proxy.proxyPath = ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user