From 6ae100e3903ae9ec8f9f23f74a38776113511c70 Mon Sep 17 00:00:00 2001 From: nkorange Date: Fri, 8 Mar 2019 10:43:26 +0800 Subject: [PATCH] Fix http client error --- .../java/com/alibaba/nacos/client/naming/net/HttpClient.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java b/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java index a0f4a4416..d05bd236d 100644 --- a/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java +++ b/client/src/main/java/com/alibaba/nacos/client/naming/net/HttpClient.java @@ -69,7 +69,7 @@ public class HttpClient { HttpURLConnection conn = null; try { String encodedContent = encodingParams(paramValues, encoding); - url += (null == encodedContent) ? "" : ("?" + encodedContent); + url += (StringUtils.isEmpty(encodedContent)) ? "" : ("?" + encodedContent); conn = (HttpURLConnection) new URL(url).openConnection(); @@ -174,7 +174,7 @@ public class HttpClient { private static String encodingParams(Map params, String encoding) throws UnsupportedEncodingException { if (null == params || params.isEmpty()) { - return null; + return ""; } params.put("encoding", encoding);