Ver código fonte

修复获取HOST无端口问题

xx 2 anos atrás
pai
commit
71328824f5
1 arquivos alterados com 6 adições e 1 exclusões
  1. 6 1
      src/net/util.cpp

+ 6 - 1
src/net/util.cpp

@@ -309,9 +309,14 @@ bool ylib::network::parse_url_host(const std::string &url, std::string &host)
     }
     __arr = strutils::split(temp,':');
     if (__arr.size() == 2)
-        host = __arr[0];
+    {
+        host = __arr[0]+":"+__arr[1];
+    }
+        
     else
         host = temp;
+
+
     return true;
 }
 bool ylib::network::is_ipv4(const std::string& value)