diff options
| author | xqyjlj <[email protected]> | 2023-05-04 10:32:16 +0800 |
|---|---|---|
| committer | xqyjlj <[email protected]> | 2023-05-04 10:32:16 +0800 |
| commit | 2f80f81f478ce16a94bfcc700fcee47217e927c5 (patch) | |
| tree | 0d65f517cd81936b33fe07c2bdc9f3efe4e5c611 /xmake/modules/net/fasturl.lua | |
| parent | bd8a03bfbf9ba0fdc41ac78632c964c76542a4f9 (diff) | |
🐞 fix(xmake/modules/net/fasturl.lua): fix _parse_host when it has a port
e.g. http://127.0.0.1:1234/hello
Diffstat (limited to 'xmake/modules/net/fasturl.lua')
| -rw-r--r-- | xmake/modules/net/fasturl.lua | 4 |
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 |
