Generate headers before proxy changes host and port

This commit is contained in:
Charles Tabor 2014-03-21 14:25:44 -05:00
parent 6d5e40c324
commit 36aa87e031

View File

@ -247,10 +247,10 @@ local function adjustrequest(reqt)
"invalid host '" .. base.tostring(nreqt.host) .. "'")
-- compute uri if user hasn't overriden
nreqt.uri = reqt.uri or adjusturi(nreqt)
-- ajust host and port if there is a proxy
nreqt.host, nreqt.port = adjustproxy(nreqt)
-- adjust headers in request
nreqt.headers = adjustheaders(nreqt)
-- ajust host and port if there is a proxy
nreqt.host, nreqt.port = adjustproxy(nreqt)
return nreqt
end
@ -353,4 +353,4 @@ _M.request = socket.protect(function(reqt, body)
else return trequest(reqt) end
end)
return _M
return _M