Skip to content

Commit

Permalink
fix(http): use the right protocol for proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
Max1Truc committed Aug 23, 2022
1 parent 95b7efa commit b976764
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/http.lua
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ 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_create = SCHEMES[proxy.scheme].create(reqt)
return proxy.host, proxy.port or 3128, proxy_create
else
return reqt.host, reqt.port
end
Expand Down Expand Up @@ -291,7 +292,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

Expand Down

0 comments on commit b976764

Please sign in to comment.