diff --git a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ApiController.java b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ApiController.java index 010d2966d..a9da7b0bb 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/controllers/ApiController.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/controllers/ApiController.java @@ -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); diff --git a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java index 485b9055f..aec660cdd 100644 --- a/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java +++ b/naming/src/main/java/com/alibaba/nacos/naming/web/DistroFilter.java @@ -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) {