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 摘要。