diff options
| author | ruki <[email protected]> | 2021-06-02 22:48:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-06-02 22:48:05 +0800 |
| commit | eee121636be554cdeef8907bd0d2fac6a23304a6 (patch) | |
| tree | 1fe24ca4d7fe8740bc222c75aa28ad03b978da63 /xmake/modules/net/proxy.lua | |
| parent | 4223c60a70bf0220f15c18fe3ec4a5dda24b317a (diff) | |
add localpkg test
Diffstat (limited to 'xmake/modules/net/proxy.lua')
| -rw-r--r-- | xmake/modules/net/proxy.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/modules/net/proxy.lua b/xmake/modules/net/proxy.lua index 8259a07c9..6aac4af4c 100644 --- a/xmake/modules/net/proxy.lua +++ b/xmake/modules/net/proxy.lua @@ -108,7 +108,7 @@ function config(url) -- enable proxy for the given url and configuration pattern if url then - -- get proxy from the given hosts pattern + -- filter proxy host from the given hosts pattern local host = url:match("://(.-)/") or url:match("@(.-):") local proxy_hosts = _proxy_hosts() if host and proxy_hosts then @@ -121,11 +121,13 @@ function config(url) end end - -- get proxy from the pac file + -- filter proxy host from the pac file local proxy_pac = _proxy_pac() - if proxy_pac and _is_callable(proxy_pac) and proxy_pac(url, host) then + if proxy_pac and host and _is_callable(proxy_pac) and proxy_pac(url, host) then return global.get("proxy") end + + -- use global proxy if not proxy_pac and not proxy_hosts then return global.get("proxy") end |
