public void postFilter()

in sample/src/main/java/org/apache/apisix/plugin/runner/filter/PostReqWithVarsFilter.java [50:62]


    public void postFilter(PostRequest request, PostResponse response, PluginFilterChain chain) {
        String configStr = request.getConfig(this);
        Gson gson = new Gson();
        Map<String, Object> conf = new HashMap<>();
        conf = gson.fromJson(configStr, conf.getClass());
        String bodyStr = request.getBody();
        Map<String, Object> body = new HashMap<>();
        body = gson.fromJson(bodyStr, body.getClass());
        assert body.get("url").toString().endsWith((String) conf.get("rewrite_path"));
        String serverPort = request.getVars("server_port");
        response.setHeader("server_port", serverPort);
        chain.postFilter(request, response);
    }