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

tydhot pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 66f991f  issues#2346  Remove spaces in ip (#2356)
66f991f is described below

commit 66f991fd187aea111dee1fcd984117e7faa9b7f0
Author: Platycodon <[email protected]>
AuthorDate: Sun Nov 14 21:51:45 2021 +0800

    issues#2346  Remove spaces in ip (#2356)
---
 .../main/java/org/apache/shenyu/common/utils/UpstreamCheckUtils.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/shenyu-common/src/main/java/org/apache/shenyu/common/utils/UpstreamCheckUtils.java
 
b/shenyu-common/src/main/java/org/apache/shenyu/common/utils/UpstreamCheckUtils.java
index 5e33dd6..41602ce 100644
--- 
a/shenyu-common/src/main/java/org/apache/shenyu/common/utils/UpstreamCheckUtils.java
+++ 
b/shenyu-common/src/main/java/org/apache/shenyu/common/utils/UpstreamCheckUtils.java
@@ -71,8 +71,8 @@ public class UpstreamCheckUtils {
             hostPort = StringUtils.split(url, Constants.COLONS);
         }
         final boolean isHttps = url.startsWith(HTTPS);
-        final int port = hostPort.length > 1 ? Integer.parseInt(hostPort[1]) : 
isHttps ? 443 : 80;
-        return isHostConnector(hostPort[0], port, timeout);
+        final int port = hostPort.length > 1 ? 
Integer.parseInt(hostPort[1].trim()) : isHttps ? 443 : 80;
+        return isHostConnector(hostPort[0].trim(), port, timeout);
     }
 
     private static boolean isHostConnector(final String host, final int port, 
final int timeout) {

Reply via email to