From def02066bc8cbcbdaf659167021266deaf7af256 Mon Sep 17 00:00:00 2001 From: hanxiantao <601803023@qq.com> Date: Thu, 23 Jan 2025 15:19:09 +0800 Subject: [PATCH 1/2] fix: Path concatenation issue for authentication requests in Envoy authentication mode --- plugins/wasm-go/extensions/ext-auth/main.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/wasm-go/extensions/ext-auth/main.go b/plugins/wasm-go/extensions/ext-auth/main.go index eee610f491..38c31a7103 100644 --- a/plugins/wasm-go/extensions/ext-auth/main.go +++ b/plugins/wasm-go/extensions/ext-auth/main.go @@ -16,7 +16,6 @@ package main import ( "net/http" - "net/url" "ext-auth/config" "ext-auth/util" @@ -91,7 +90,7 @@ func checkExtAuth(ctx wrapper.HttpContext, cfg config.ExtAuthConfig, body []byte requestPath := httpServiceConfig.Path if httpServiceConfig.EndpointMode == config.EndpointModeEnvoy { requestMethod = ctx.Method() - requestPath, _ = url.JoinPath(httpServiceConfig.PathPrefix, ctx.Path()) + requestPath = httpServiceConfig.PathPrefix + ctx.Path() } // Call ext auth server From 9e354e138df0bcc0f03d94932c7c49c8387d6219 Mon Sep 17 00:00:00 2001 From: hanxiantao <601803023@qq.com> Date: Thu, 23 Jan 2025 15:43:57 +0800 Subject: [PATCH 2/2] fix: Path concatenation issue for authentication requests in Envoy authentication mode --- plugins/wasm-go/extensions/ext-auth/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/wasm-go/extensions/ext-auth/main.go b/plugins/wasm-go/extensions/ext-auth/main.go index 38c31a7103..8cc8c05952 100644 --- a/plugins/wasm-go/extensions/ext-auth/main.go +++ b/plugins/wasm-go/extensions/ext-auth/main.go @@ -16,6 +16,7 @@ package main import ( "net/http" + "path" "ext-auth/config" "ext-auth/util" @@ -90,7 +91,7 @@ func checkExtAuth(ctx wrapper.HttpContext, cfg config.ExtAuthConfig, body []byte requestPath := httpServiceConfig.Path if httpServiceConfig.EndpointMode == config.EndpointModeEnvoy { requestMethod = ctx.Method() - requestPath = httpServiceConfig.PathPrefix + ctx.Path() + requestPath = path.Join(httpServiceConfig.PathPrefix, ctx.Path()) } // Call ext auth server