savingrun opened a new issue, #204:
URL: https://github.com/apache/apisix-java-plugin-runner/issues/204

   ### Issue description
   The `postFilter` has taken effect, but now I encounter another problem, that 
is, the `token` in the `request` of the `client` cannot be obtained in the 
`upstreamHeaders`. I wonder if I understand it wrong?
   
   **request parameters:**
   
   ``` shell
   curl --location --request GET 
'http://10.0.10.165/boom-center-user-service/test/leaf' \
   --header 'tenant-id: 1' \
   --header 'Member-Token: 
BOOMeyJ0eXBlIjoiSldUIiwiYWxnIjoiSFMyNTYifQ.eyJpc3MiOiJCT09NIiwiaWF0IjoxNjY1NTQ1MzY2LCJwbGF0Zm9ybSI6MSwiYXZhdGFyIjoicyIsIkFDQ09VTlRfSUQiOjE0NjI2ODY3ODgwNTEyNjc1ODUsImlkIjoxNTYwODczNjA2MDE4MjM2NDE3LCJuYW1lIjoicyIsImV4cCI6MTMwNTE0NTY0MTg2fQ.waaLOKbByRStWme9K8sHBPTIejSC84Hh9dNIGxXlKlw'
   ```
   
   **filter code:**
   
   ``` java
   @Override
   public void postFilter(PostRequest request, PostResponse response, 
PluginFilterChain chain) {
       Map<String, String> upstreamHeaders = request.getUpstreamHeaders();
       log.debug("postFilter test: upstreamHeaders {}", 
JSONUtil.toJsonStr(upstreamHeaders));
       log.debug("postFilter test: response {}", JSONUtil.toJsonStr(response));
       response.setHeader("new-token", "savingrun");
       chain.postFilter(request, response);
   }
   ```
   
   **log:**
   
   ``` shell
   2022/10/18 16:03:26 [warn] 14817#14817: *3556373 [lua] init.lua:913: 
2022-10-18 16:03:26.695 DEBUG 14822 --- [ntLoopGroup-2-3] 
c.b.a.f.AuthGlobalFilter                 : postFilter test: upstreamHeaders 
{"Transfer-Encoding":"chunked","Keep-Alive":"timeout=3","Connection":"keep-alive","Date":"Tue,
 18 Oct 2022 08:03:18 GMT","Content-Type":"application/json"}
   2022-10-18 16:03:26.695 DEBUG 14822 --- [ntLoopGroup-2-3] 
c.b.a.f.AuthGlobalFilter                 : postFilter test: response {}
   2022-10-18 16:03:26.695 DEBUG 14822 --- [ntLoopGroup-2-3] 
i.n.h.l.LoggingHandler                   : [id: 0x98af5762] WRITE: 92B
   ``` 
   
   ### Environment
   
   - apisix-java-plugin-runner version v0.3.0
   - apisix version v2.15
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to