#502 Fix client beat bug
This commit is contained in:
parent
12c032cb98
commit
51dd3db7c3
@ -24,6 +24,7 @@ import com.alibaba.nacos.naming.core.DistroMapper;
|
||||
import com.alibaba.nacos.naming.core.ServiceManager;
|
||||
import com.alibaba.nacos.naming.misc.UtilsAndCommons;
|
||||
import com.alibaba.nacos.naming.push.ClientInfo;
|
||||
import com.alibaba.nacos.naming.web.CanDistro;
|
||||
import com.alibaba.nacos.naming.web.OverrideParameterRequestWrapper;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -138,6 +139,7 @@ public class ApiController extends InstanceController {
|
||||
agent, clusters, clientIP, udpPort, env, isCheck, app, tenant, healthyOnly);
|
||||
}
|
||||
|
||||
@CanDistro
|
||||
@RequestMapping("/clientBeat")
|
||||
public JSONObject clientBeat(HttpServletRequest request) throws Exception {
|
||||
OverrideParameterRequestWrapper requestWrapper = OverrideParameterRequestWrapper.buildRequest(request);
|
||||
|
@ -68,6 +68,10 @@ public class DistroFilter implements Filter {
|
||||
try {
|
||||
String path = new URI(req.getRequestURI()).getPath();
|
||||
String serviceName = req.getParameter(CommonParams.SERVICE_NAME);
|
||||
// For client under 0.8.0:
|
||||
if (StringUtils.isBlank(serviceName)) {
|
||||
serviceName = req.getParameter("dom");
|
||||
}
|
||||
Method method = filterBase.getMethod(req.getMethod(), path);
|
||||
|
||||
if (method == null) {
|
||||
|
Loading…
Reference in New Issue
Block a user