summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxqyjlj <[email protected]>2023-05-04 10:32:16 +0800
committerxqyjlj <[email protected]>2023-05-04 10:32:16 +0800
commit2f80f81f478ce16a94bfcc700fcee47217e927c5 (patch)
tree0d65f517cd81936b33fe07c2bdc9f3efe4e5c611
parentbd8a03bfbf9ba0fdc41ac78632c964c76542a4f9 (diff)
🐞 fix(xmake/modules/net/fasturl.lua): fix _parse_host when it has a port
e.g. http://127.0.0.1:1234/hello
-rw-r--r--xmake/modules/net/fasturl.lua4
1 files 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 [email protected]:xxx/xxx.git
+-- http[s]://xxx.com[:1234]/.. or [email protected]: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