Merge pull request #2528 from theonefx/develop
fix: https://github.com/alibaba/nacos/issues/2527
This commit is contained in:
commit
449ed0831a
@ -48,7 +48,9 @@ import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
@ -327,7 +329,11 @@ public class NamingProxy {
|
||||
Map<String, String> params = new HashMap<String, String>(8);
|
||||
String body = StringUtils.EMPTY;
|
||||
if (!lightBeatEnabled) {
|
||||
body = "beat=" + JSON.toJSONString(beatInfo);
|
||||
try {
|
||||
body = "beat=" + URLEncoder.encode(JSON.toJSONString(beatInfo), "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new NacosException(NacosException.SERVER_ERROR, "encode beatInfo error", e);
|
||||
}
|
||||
}
|
||||
params.put(CommonParams.NAMESPACE_ID, namespaceId);
|
||||
params.put(CommonParams.SERVICE_NAME, beatInfo.getServiceName());
|
||||
|
Loading…
Reference in New Issue
Block a user