Open jinnyu opened 11 months ago
Can you post your filter logic?
Can you post your filter logic?
@Override
public void filter(HttpRequest request, HttpResponse response, PluginFilterChain chain) {
// 这里取到的值为 null
String authorization = request.getHeader(ConstHttp.HEADER_AUTHORIZATION);
// 验证token
ApisixAuthResult result = helper.verifyToken(authorization);
if (result.isSuccess()) {
chain.filter(request, response);
} else {
log.warn(result.getMsg());
response.setStatusCode(401);
response.setHeader("Content-Type", "application/json");
response.setBody("{\"code\":\"A01101\",\"msg\":\"身份验证失败\",\"data\": null}");
}
}
It seems that your problem is similar to this #254 , you can wait for this problem to be resolved and try again.
@jinnyu
Issue description
I used the java runner plugin to perform pre authentication, but now the
HttpRequest
object does not have the header values pass throuth.Environment
running in k8s APISIX v3.4.1-centos plugin runner : 0.4.0