diff options
Diffstat (limited to 'src')
| -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 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 |
| 25 | TIMEOUT = 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 | |||
| 186 | local function adjusturi(reqt) | 186 | local 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) | |||
| 198 | end | 198 | end |
| 199 | 199 | ||
| 200 | local function adjustproxy(reqt) | 200 | local 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 |
