apache / apache/apisix-java-plugin-runner

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

Aberta
#262 1 comentário 1 reação 0 responsáveis Ver no GitHub
Linguagem predominante
Java
Estrelas
152
Forks
102
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.