apache / apache/apisix-java-plugin-runner

bug: ext-plugin-post-resp can't get duplicate headers from upstream response, such as Set-Cookie

未关闭
#262 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Java
星标
152
派生
102
PR 合并指标
30 天内没有已合并 PR

描述

### Environment

* 0.4.0

### Steps to reproduce the issue
1. use `ext-plugin-post-resp` `postFilter(PostRequest request, PostResponse response, PluginFilterChain chain)`
2. use `request.getUpstreamHeaders()` to get headers
3. upstream response
```
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sat, 19-Aug-2023 05:45:05 GMT
Set-Cookie: JSESSIONID=deleteMe; Path=/; Max-Age=0; Expires=Sat, 19-Aug-2023 05:45:05 GMT
Set-Cookie: JSESSIONID=0bc8714b-e1bf-4077-baaa-b94c8ba10a05; Path=/; HttpOnly
Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sat, 19-Aug-2023 05:45:05 GMT
```
### What's the actual result? (including assertion message & call stack if applicable)
just get the last Set-Cookie item `Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Sat, 19-Aug-2023 05:45:05 GMT`

### What's the expected result?

1. can get duplicate headers with `Multimap` data structure
2. can set duplicate headers

### One more thing!
It is recommended that ext-plugin-post-resp inherits all the headers of upstream by default, so you don't need to write them again in the plugin.

eg:
1. upstream return content-type = text/html
2. empty code in `postFilter(PostRequest request, PostResponse response, PluginFilterChain chain)`
3. the client get content-type = text/pain

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。