apache / apisix-java-plugin-runner

APISIX Plugin Runner in Java
https://apisix.apache.org/
Apache License 2.0
126 stars 95 forks source link

bug: On applying any ext-plugin-post-resp, any header set by upstream service was not passed to downstream #254

Open abhi0476 opened 1 year ago

abhi0476 commented 1 year ago

If we apply any ext-plugin-post-resp filter any header set by upstream service was not passed to downstream.

Also There is no provision for setting multiple headers as headers is made as private Map<String, String> headers; instead it should be private Map<String, List> headers in PostResponse.java and PostRequest.java

Environment

Minimal test code / Steps to reproduce the issue

  1. Apply any developed filter on ext-plugin-post-resp
  2. Set some header say cookie on upstream server
  3. Check response on httpclient, upstream headers has been ommitted

What's the actual result? (including assertion message & call stack if applicable)

Headers is not available on downstream

What's the expected result?

Headers should be available on downstream

Attaching a fix for the same apisix.zip

Sn0rt commented 1 year ago

thx you very much. and can you create a PR ?

abhi0476 commented 1 year ago

thx you very much. and can you create a PR ? How to do that? In which branch should I commit and push first?

juzhiyuan commented 1 year ago

Hi @abhi0476,

  1. You need to click fork at https://github.com/apache/apisix-java-plugin-runner
  2. Commit changes to the main branch
  3. Submit a PR
abhi0476 commented 1 year ago

Hi @abhi0476,

  1. You need to click fork at https://github.com/apache/apisix-java-plugin-runner
  2. Commit changes to the main branch
  3. Submit a PR

Done