Compare commits

..

2 Commits

Author SHA1 Message Date
Max1Truc
8051b11898 fix(http): use the right protocol for proxies
Previously, if doing a request to http://website.example.org
 through https://proxy.example.org, luasocket wouldn't use TLS
 and vice-versa
2023-11-21 22:42:15 +01:00
_AMD_
13f2b3c663
fix(http): Correct receiveheaders() handling of folded values (#420) 2023-11-13 23:33:26 +03:00

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 = sock:receive() line, err = 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
@ -293,7 +293,9 @@ local function adjustrequest(reqt)
end end
-- ajust host and port if there is a proxy -- ajust host and port if there is a proxy
nreqt.host, nreqt.port, nreqt.create = 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