apache / apache/apisix-java-plugin-runner

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

Open
#262 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
152
Forks
102
PR merge metrics
No merged PRs in 30d

Description

### 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.