diff options
Diffstat (limited to 'test/httptest.lua')
-rw-r--r-- | test/httptest.lua | 16 |
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 |
6 | dofile("noglobals.lua") | 6 | dofile("noglobals.lua") |
7 | 7 | ||
8 | local host, proxyh, proxyp, request, response | 8 | local host, proxyhost, proxyport, request, response |
9 | local ignore, expect, index, prefix, cgiprefix | 9 | local ignore, expect, index, prefix, cgiprefix |
10 | 10 | ||
11 | local t = socket.time() | 11 | local t = socket.time() |
12 | 12 | ||
13 | host = host or "diego.princeton.edu" | 13 | host = host or "diego.princeton.edu" |
14 | proxyh = proxyh or "localhost" | 14 | proxyhost = proxyhost or "localhost" |
15 | proxyp = proxyp or 3128 | 15 | proxyport = proxyport or 3128 |
16 | prefix = prefix or "/luasocket-test" | 16 | prefix = prefix or "/luasocket-test" |
17 | cgiprefix = cgiprefix or "/luasocket-test-cgi" | 17 | cgiprefix = 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 | } |
135 | expect = { | 135 | expect = { |
136 | body = index, | 136 | body = index, |
@@ -170,8 +170,8 @@ check_request(request, expect, ignore) | |||
170 | io.write("testing proxy with redirection: ") | 170 | io.write("testing proxy with redirection: ") |
171 | request = { | 171 | request = { |
172 | url = "http://" .. host .. prefix, | 172 | url = "http://" .. host .. prefix, |
173 | host = proxyh, | 173 | proxyhost = proxyhost, |
174 | port = proxyp | 174 | proxyport = proxyport |
175 | } | 175 | } |
176 | expect = { | 176 | expect = { |
177 | body = index, | 177 | body = index, |
@@ -267,7 +267,7 @@ io.write("testing manual basic auth: ") | |||
267 | request = { | 267 | request = { |
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 | } |
273 | expect = { | 273 | expect = { |