MariaLapovska commented on issue #13015:
URL: https://github.com/apache/apisix/issues/13015#issuecomment-3915607960

   @shreemaan-abhishek 
   
   In the java plugin runner:
   ```java
   public class AuthorizationFilter implements PluginFilter {
     @Override
     public void filter(HttpRequest request, HttpResponse response, 
PluginFilterChain chain) {
       //... some logic ...
       request.setHeader(AUTHORIZATION, AUTHORIZATION_PREFIX_BEARER + " " + 
cachedToken);
     }
   }
   
   public class PostRespFilter implements PluginFilter {
     @Override
     public void postFilter(PostRequest request, PostResponse response, 
PluginFilterChain chain) {
       //... some logic ...
      response.setStatusCode(200);
     }
   }
   ```
   In the route config:
   
   ```yaml
   routes:
     - id: oauth-token
       uri: /token/swap
       upstream:
         pass_host: "node"
         nodes:
           "wiremock:8080": 1
         type: roundrobin
       plugin_config_id: 1
   
   plugin_configs:
     - id: 1
       plugins:
         ext-plugin-pre-req:
           conf:
             - name: "AuthorizationFilter"
               value: ""
         ext-plugin-post-resp:
           conf:
             - name: "PostRespFilter"
               value: ""
   ```
   
   
   When I enable logs in upstream I can see that authorization header value is 
never updated to the value set in AuthorizationFilter, but instead is the 
original value passed in request. But when I remove PostRespFilter from that 
route config, the value is propagated correctly.


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