aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2013-07-05 12:40:49 -0700
committerDiego Nehab <diego.nehab@gmail.com>2013-07-05 12:40:49 -0700
commit6bdb00e24ca88f271774c2102f631e70f04b249d (patch)
treedd1b42120c370d8e91d754693153fd668b19329f /src
parent22cd5833fcc0e272f26004a79c8545e959ba406b (diff)
parent1f9ccb2b586c3a7e29db3c99a23ac1cee6907cf2 (diff)
downloadluasocket-6bdb00e24ca88f271774c2102f631e70f04b249d.tar.gz
luasocket-6bdb00e24ca88f271774c2102f631e70f04b249d.tar.bz2
luasocket-6bdb00e24ca88f271774c2102f631e70f04b249d.zip
Merge pull request #69 from catwell/pull-globals
fixes related to constants in the HTTP module
Diffstat (limited to 'src')
-rw-r--r--src/http.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http.lua b/src/http.lua
index ac4b2d6..f83dcc5 100644
--- a/src/http.lua
+++ b/src/http.lua
@@ -22,7 +22,7 @@ local _M = socket.http
22-- Program constants 22-- Program constants
23----------------------------------------------------------------------------- 23-----------------------------------------------------------------------------
24-- connection timeout in seconds 24-- connection timeout in seconds
25TIMEOUT = 60 25_M.TIMEOUT = 60
26-- default port for document retrieval 26-- default port for document retrieval
27_M.PORT = 80 27_M.PORT = 80
28-- user agent field sent in request 28-- user agent field sent in request
@@ -186,7 +186,7 @@ end
186local function adjusturi(reqt) 186local function adjusturi(reqt)
187 local u = reqt 187 local u = reqt
188 -- if there is a proxy, we need the full url. otherwise, just a part. 188 -- if there is a proxy, we need the full url. otherwise, just a part.
189 if not reqt.proxy and not PROXY then 189 if not reqt.proxy and not _M.PROXY then
190 u = { 190 u = {
191 path = socket.try(reqt.path, "invalid path 'nil'"), 191 path = socket.try(reqt.path, "invalid path 'nil'"),
192 params = reqt.params, 192 params = reqt.params,
@@ -198,7 +198,7 @@ local function adjusturi(reqt)
198end 198end
199 199
200local function adjustproxy(reqt) 200local function adjustproxy(reqt)
201 local proxy = reqt.proxy or PROXY 201 local proxy = reqt.proxy or _M.PROXY
202 if proxy then 202 if proxy then
203 proxy = url.parse(proxy) 203 proxy = url.parse(proxy)
204 return proxy.host, proxy.port or 3128 204 return proxy.host, proxy.port or 3128