diff options
author | Charles Tabor <chastabor@gmail.com> | 2014-03-21 14:25:44 -0500 |
---|---|---|
committer | Charles Tabor <chastabor@gmail.com> | 2014-03-21 14:25:44 -0500 |
commit | 36aa87e03158451df8e51bf8dcd3942134e3d8d8 (patch) | |
tree | 85ce82d855598d12b1eec1ca228d939a3dbb8f9f | |
parent | 6d5e40c324c84d9c1453ae88e0ad5bdd0a631448 (diff) | |
download | luasocket-36aa87e03158451df8e51bf8dcd3942134e3d8d8.tar.gz luasocket-36aa87e03158451df8e51bf8dcd3942134e3d8d8.tar.bz2 luasocket-36aa87e03158451df8e51bf8dcd3942134e3d8d8.zip |
Generate headers before proxy changes host and port
-rw-r--r-- | src/http.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http.lua b/src/http.lua index 1d0eb50..204a841 100644 --- a/src/http.lua +++ b/src/http.lua | |||
@@ -247,10 +247,10 @@ local function adjustrequest(reqt) | |||
247 | "invalid host '" .. base.tostring(nreqt.host) .. "'") | 247 | "invalid host '" .. base.tostring(nreqt.host) .. "'") |
248 | -- compute uri if user hasn't overriden | 248 | -- compute uri if user hasn't overriden |
249 | nreqt.uri = reqt.uri or adjusturi(nreqt) | 249 | nreqt.uri = reqt.uri or adjusturi(nreqt) |
250 | -- ajust host and port if there is a proxy | ||
251 | nreqt.host, nreqt.port = adjustproxy(nreqt) | ||
252 | -- adjust headers in request | 250 | -- adjust headers in request |
253 | nreqt.headers = adjustheaders(nreqt) | 251 | nreqt.headers = adjustheaders(nreqt) |
252 | -- ajust host and port if there is a proxy | ||
253 | nreqt.host, nreqt.port = adjustproxy(nreqt) | ||
254 | return nreqt | 254 | return nreqt |
255 | end | 255 | end |
256 | 256 | ||
@@ -353,4 +353,4 @@ _M.request = socket.protect(function(reqt, body) | |||
353 | else return trequest(reqt) end | 353 | else return trequest(reqt) end |
354 | end) | 354 | end) |
355 | 355 | ||
356 | return _M \ No newline at end of file | 356 | return _M |