aboutsummaryrefslogtreecommitdiff
path: root/test/httptest.lua
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-01-19 05:41:30 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-01-19 05:41:30 +0000
commit5b8d7dec541a618b4ca7f2205470a28cde2e3e25 (patch)
tree209ad0c80c9a938068401fc5b8fa51942972418f /test/httptest.lua
parent6ac82d50eecdf9bf55f4234ed3a5449afd7a2992 (diff)
downloadluasocket-5b8d7dec541a618b4ca7f2205470a28cde2e3e25.tar.gz
luasocket-5b8d7dec541a618b4ca7f2205470a28cde2e3e25.tar.bz2
luasocket-5b8d7dec541a618b4ca7f2205470a28cde2e3e25.zip
Updated some of the callbacks in callback.lua.
Update get.lua to use the new callbacks. The old "code" module is now the "mime" module. Updated all modules that depended on it. Updated url.lua to use the new namespace scheme, and moved the escape and unescape functions that used to be in the code.lua module to it, since these are specific to urls. Updated the callback entries in the manual.
Diffstat (limited to 'test/httptest.lua')
-rw-r--r--test/httptest.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/httptest.lua b/test/httptest.lua
index 3d0db87..dc90741 100644
--- a/test/httptest.lua
+++ b/test/httptest.lua
@@ -5,14 +5,14 @@
5-- needs "AllowOverride AuthConfig" on /home/c/diego/tec/luasocket/test/auth 5-- needs "AllowOverride AuthConfig" on /home/c/diego/tec/luasocket/test/auth
6dofile("noglobals.lua") 6dofile("noglobals.lua")
7 7
8local host, proxyh, proxyp, request, response 8local host, proxyhost, proxyport, request, response
9local ignore, expect, index, prefix, cgiprefix 9local ignore, expect, index, prefix, cgiprefix
10 10
11local t = socket.time() 11local t = socket.time()
12 12
13host = host or "diego.princeton.edu" 13host = host or "diego.princeton.edu"
14proxyh = proxyh or "localhost" 14proxyhost = proxyhost or "localhost"
15proxyp = proxyp or 3128 15proxyport = proxyport or 3128
16prefix = prefix or "/luasocket-test" 16prefix = prefix or "/luasocket-test"
17cgiprefix = cgiprefix or "/luasocket-test-cgi" 17cgiprefix = cgiprefix or "/luasocket-test-cgi"
18 18
@@ -129,8 +129,8 @@ request = {
129 method = "POST", 129 method = "POST",
130 body = index, 130 body = index,
131 headers = { ["content-length"] = string.len(index) }, 131 headers = { ["content-length"] = string.len(index) },
132 port = proxyp, 132 proxyport = proxyport,
133 host = proxyh 133 proxyhost = proxyhost
134} 134}
135expect = { 135expect = {
136 body = index, 136 body = index,
@@ -170,8 +170,8 @@ check_request(request, expect, ignore)
170io.write("testing proxy with redirection: ") 170io.write("testing proxy with redirection: ")
171request = { 171request = {
172 url = "http://" .. host .. prefix, 172 url = "http://" .. host .. prefix,
173 host = proxyh, 173 proxyhost = proxyhost,
174 port = proxyp 174 proxyport = proxyport
175} 175}
176expect = { 176expect = {
177 body = index, 177 body = index,
@@ -267,7 +267,7 @@ io.write("testing manual basic auth: ")
267request = { 267request = {
268 url = "http://" .. host .. prefix .. "/auth/index.html", 268 url = "http://" .. host .. prefix .. "/auth/index.html",
269 headers = { 269 headers = {
270 authorization = "Basic " .. (socket.code.b64("luasocket:password")) 270 authorization = "Basic " .. (socket.mime.b64("luasocket:password"))
271 } 271 }
272} 272}
273expect = { 273expect = {