fix: Path concatenation issue for authentication requests in Envoy authentication mode (#1709)

This commit is contained in:
韩贤涛
2025-01-23 15:47:07 +08:00
committed by GitHub
parent 7840167c4a
commit 574d1aa36a

View File

@@ -16,7 +16,7 @@ package main
import ( import (
"net/http" "net/http"
"net/url" "path"
"ext-auth/config" "ext-auth/config"
"ext-auth/util" "ext-auth/util"
@@ -91,7 +91,7 @@ func checkExtAuth(ctx wrapper.HttpContext, cfg config.ExtAuthConfig, body []byte
requestPath := httpServiceConfig.Path requestPath := httpServiceConfig.Path
if httpServiceConfig.EndpointMode == config.EndpointModeEnvoy { if httpServiceConfig.EndpointMode == config.EndpointModeEnvoy {
requestMethod = ctx.Method() requestMethod = ctx.Method()
requestPath, _ = url.JoinPath(httpServiceConfig.PathPrefix, ctx.Path()) requestPath = path.Join(httpServiceConfig.PathPrefix, ctx.Path())
} }
// Call ext auth server // Call ext auth server