Skip to content

Commit

Permalink
alibaba#502 Fix client beat bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nkorange committed Apr 1, 2019
1 parent 12c032c commit 51dd3db
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
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;
Expand Down Expand Up @@ -138,6 +139,7 @@ public JSONObject srvIPXT(HttpServletRequest request) throws Exception {
agent, clusters, clientIP, udpPort, env, isCheck, app, tenant, healthyOnly);
}

@CanDistro
@RequestMapping("/clientBeat")
public JSONObject clientBeat(HttpServletRequest request) throws Exception {
OverrideParameterRequestWrapper requestWrapper = OverrideParameterRequestWrapper.buildRequest(request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ public void doFilter(ServletRequest servletRequest, ServletResponse servletRespo
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) {
Expand Down

0 comments on commit 51dd3db

Please sign in to comment.