mirror of
https://github.com/lunarmodules/luasocket.git
synced 2024-12-25 12:08:21 +01:00
http: look for PROXY in _M, not as a global
This commit is contained in:
parent
ddf88aca09
commit
1f9ccb2b58
@ -186,7 +186,7 @@ end
|
||||
local function adjusturi(reqt)
|
||||
local u = reqt
|
||||
-- if there is a proxy, we need the full url. otherwise, just a part.
|
||||
if not reqt.proxy and not PROXY then
|
||||
if not reqt.proxy and not _M.PROXY then
|
||||
u = {
|
||||
path = socket.try(reqt.path, "invalid path 'nil'"),
|
||||
params = reqt.params,
|
||||
@ -198,7 +198,7 @@ local function adjusturi(reqt)
|
||||
end
|
||||
|
||||
local function adjustproxy(reqt)
|
||||
local proxy = reqt.proxy or PROXY
|
||||
local proxy = reqt.proxy or _M.PROXY
|
||||
if proxy then
|
||||
proxy = url.parse(proxy)
|
||||
return proxy.host, proxy.port or 3128
|
||||
|
Loading…
Reference in New Issue
Block a user