mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-04-30 20:26:44 +02:00
Compare commits
3 Commits
1531e31dfb
...
8f3ed370ea
Author | SHA1 | Date | |
---|---|---|---|
|
8f3ed370ea | ||
|
c19b111bc1 | ||
|
13f2b3c663 |
10
src/http.lua
10
src/http.lua
@ -62,7 +62,7 @@ local function receiveheaders(sock, headers)
|
||||
-- unfold any folded values
|
||||
while string.find(line, "^%s") do
|
||||
value = value .. line
|
||||
line = sock:receive()
|
||||
line, err = sock:receive()
|
||||
if err then return nil, err end
|
||||
end
|
||||
-- save pair in table
|
||||
@ -219,9 +219,11 @@ local function adjustproxy(reqt)
|
||||
local proxy = reqt.proxy or _M.PROXY
|
||||
if proxy then
|
||||
proxy = url.parse(proxy)
|
||||
return proxy.host, proxy.port or 3128
|
||||
proxy.port = proxy.port or 3128
|
||||
proxy.create = SCHEMES[proxy.scheme].create(reqt)
|
||||
return proxy.host, proxy.port, proxy.create
|
||||
else
|
||||
return reqt.host, reqt.port
|
||||
return reqt.host, reqt.port, reqt.create
|
||||
end
|
||||
end
|
||||
|
||||
@ -291,7 +293,7 @@ local function adjustrequest(reqt)
|
||||
end
|
||||
|
||||
-- ajust host and port if there is a proxy
|
||||
nreqt.host, nreqt.port = adjustproxy(nreqt)
|
||||
nreqt.host, nreqt.port, nreqt.create = adjustproxy(nreqt)
|
||||
return nreqt
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user