#502 Fix client beat bug

This commit is contained in:
nkorange 2019-04-01 14:31:02 +08:00
parent 12c032cb98
commit 51dd3db7c3
2 changed files with 6 additions and 0 deletions

View File

@ -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);

View File

@ -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) {