fix(oidc): fix Set-Cookie header corruption during session refresh (#3928)

Signed-off-by: jingze <daijingze.djz@alibaba-inc.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jingze
2026-06-05 17:58:20 +08:00
committed by GitHub
parent 137d76332e
commit 57db9ccc46
3 changed files with 8 additions and 4 deletions

View File

@@ -84,7 +84,11 @@ func onHttpRequestHeaders(ctx wrapper.HttpContext, config PluginConfig, log log.
func onHttpResponseHeaders(ctx wrapper.HttpContext, config PluginConfig, log log.Log) types.Action {
value := ctx.GetContext(oidc.SetCookieHeader)
if value != nil {
proxywasm.AddHttpResponseHeader(oidc.SetCookieHeader, value.(string))
if cookies, ok := value.([]string); ok {
for _, c := range cookies {
proxywasm.AddHttpResponseHeader(oidc.SetCookieHeader, c)
}
}
}
config.oidcHandler.SetContext(nil)
return types.ActionContinue