From 2f80f81f478ce16a94bfcc700fcee47217e927c5 Mon Sep 17 00:00:00 2001 From: xqyjlj Date: Thu, 4 May 2023 10:32:16 +0800 Subject: 🐞 fix(xmake/modules/net/fasturl.lua): fix _parse_host when it has a port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e.g. http://127.0.0.1:1234/hello --- xmake/modules/net/fasturl.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xmake/modules/net/fasturl.lua b/xmake/modules/net/fasturl.lua index 1849d4784..aacb81378 100644 --- a/xmake/modules/net/fasturl.lua +++ b/xmake/modules/net/fasturl.lua @@ -21,10 +21,10 @@ -- imports import("ping") --- http[s]://xxx.com/.. or git@git.xxx.com:xxx/xxx.git +-- http[s]://xxx.com[:1234]/.. or git@git.xxx.com:xxx/xxx.git function _parse_host(url) _g._URLHOSTS = _g._URLHOSTS or {} - local host = _g._URLHOSTS[url] or url:match("://(.-)/") or url:match("@(.-):") + local host = _g._URLHOSTS[url] or url:match("://([^/:]+)") or url:match("@(.-):") _g._URLHOSTS[url] = host return host end -- cgit v1.3.1