Compare commits

..

1 Commits

View File

@ -62,7 +62,7 @@ local function receiveheaders(sock, headers)
-- unfold any folded values -- unfold any folded values
while string.find(line, "^%s") do while string.find(line, "^%s") do
value = value .. line value = value .. line
line, err = sock:receive() line = sock:receive()
if err then return nil, err end if err then return nil, err end
end end
-- save pair in table -- save pair in table
@ -219,11 +219,9 @@ local function adjustproxy(reqt)
local proxy = reqt.proxy or _M.PROXY local proxy = reqt.proxy or _M.PROXY
if proxy then if proxy then
proxy = url.parse(proxy) proxy = url.parse(proxy)
proxy.port = proxy.port or 3128 return proxy.host, proxy.port or 3128
proxy.create = SCHEMES[proxy.scheme].create(reqt)
return proxy.host, proxy.port, proxy.create
else else
return reqt.host, reqt.port, reqt.create return reqt.host, reqt.port
end end
end end
@ -293,10 +291,7 @@ local function adjustrequest(reqt)
end end
-- ajust host and port if there is a proxy -- ajust host and port if there is a proxy
local proxy_create nreqt.host, nreqt.port = adjustproxy(nreqt)
nreqt.host, nreqt.port, proxy_create = adjustproxy(nreqt)
if not reqt.create then nreqt.create = proxy_create end
return nreqt return nreqt
end end