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

   ### Issue description
   I want to get the upstream response content in the plugin for processing and 
then return to the client, but it return null
   This is how the class is handled:
   @Override
       public void postFilter(PostRequest request, PostResponse response, 
PluginFilterChain chain) {
           log.warn("ClientAuthenticationFilter is running");
          
           log.warn("status:{}", request.getUpstreamStatusCode());
          // get the upstream response body
           String responseBody = request.getBody();
           ResultData<ActivityLoginUser> resultData = 
JsonUtils.json2Bean(responseBody , ResultData.class);
           ResultData<AuthUserVo> authResult = new ResultData<>();
           authResult.setCode(resultData.getCode());
           authResult.setMessage(resultData.getMessage());
           if(ObjectUtils.isNotEmpty(resultData.getData())){
               AuthUserVo authUserVo = processAuthResult(resultData.getData());
               authResult.setData(authUserVo);
           }
           response.setBody(JsonUtils.bean2Json(authResult));
            chain.postFilter(request, response);
       }
   
   
   java.lang.NullPointerException: null
   at 
com.taikang.tlife.activity.apisix.plugins.fliters.ClientAuthenticationFilter.postFilter(ClientAuthenticationFilter.java:85)
 
   ### Environment
   
   * your apisix-java-plugin-runner version 0.4.0
   


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