You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/05/21 06:33:25 UTC

[incubator-servicecomb-java-chassis] 02/03: [SCB-591] configcenter need to do encode, modify

This is an automated email from the ASF dual-hosted git repository.

liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git

commit f676a760ab5e84a3a1fcafa7ea1981c63aae474c
Author: weichao666 <we...@huawei.com>
AuthorDate: Fri May 18 09:13:04 2018 +0800

    [SCB-591] configcenter need to do encode,modify
---
 .../org/apache/servicecomb/config/client/ConfigCenterClient.java  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
index c2b31a2..ca9d118 100644
--- a/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
+++ b/dynamic-config/config-cc/src/main/java/org/apache/servicecomb/config/client/ConfigCenterClient.java
@@ -331,11 +331,11 @@ public class ConfigCenterClient {
       CountDownLatch latch = new CountDownLatch(1);
       String encodeServiceName = "";
       try {
-        encodeServiceName = URLEncoder.encode(serviceName, "UTF-8");
-      } catch (UnsupportedEncodingException e1) {
-        e1.printStackTrace();
+        encodeServiceName = URLEncoder.encode(StringUtils.deleteWhitespace(serviceName), "UTF-8");
+      } catch (UnsupportedEncodingException e) {
+        LOGGER.error("encode error: {}",e.getMessage());
       }
-      String path = URIConst.ITEMS + "?dimensionsInfo=" + StringUtils.deleteWhitespace(encodeServiceName);
+      String path = URIConst.ITEMS + "?dimensionsInfo=" + encodeServiceName;
       clientMgr.findThreadBindClientPool().runOnContext(client -> {
         IpPort ipPort = NetUtils.parseIpPortFromURI(configcenter);
         HttpClientRequest request = client.get(ipPort.getPort(), ipPort.getHostOrIp(), path, rsp -> {

-- 
To stop receiving notification emails like this one, please contact
liubao@apache.org.