Compare commits

..

1 Commits

Author SHA1 Message Date
Max1Truc
c19b111bc1 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-13 23:57:20 +01:00

View File

@ -62,7 +62,7 @@ local function receiveheaders(sock, headers)
-- unfold any folded values
while string.find(line, "^%s") do
value = value .. line
line, err = sock:receive()
line = sock:receive()
if err then return nil, err end
end
-- save pair in table
@ -293,9 +293,7 @@ local function adjustrequest(reqt)
end
-- ajust host and port if there is a proxy
nreqt.host, nreqt.port, proxy_create = adjustproxy(nreqt)
if not reqt.create then nreqt.create = proxy_create end
nreqt.host, nreqt.port, nreqt.create = adjustproxy(nreqt)
return nreqt
end