mirror of
https://github.com/lunarmodules/luasocket.git
synced 2025-08-28 06:42:25 +02:00
Couple bug fixes.
This commit is contained in:
@@ -119,9 +119,8 @@ check_request(request, expect, ignore)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
io.write("testing invalid url: ")
|
||||
local c, e = socket.connect("", 80)
|
||||
local r, re = http.request{url = host .. prefix}
|
||||
assert(r == nil and e == re)
|
||||
local r, e = http.request{url = host .. prefix}
|
||||
assert(r == nil and e == "invalid host ''")
|
||||
r, re = http.request(host .. prefix)
|
||||
assert(r == nil and e == re, tostring(r) ..", " .. tostring(re) ..
|
||||
" vs " .. tostring(e))
|
||||
|
@@ -101,7 +101,7 @@ control:setoption("tcp-nodelay", true)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
function test_methods(sock, methods)
|
||||
for _, v in methods do
|
||||
for _, v in pairs(methods) do
|
||||
if type(sock[v]) ~= "function" then
|
||||
fail(sock.class .. " method '" .. v .. "' not registered")
|
||||
end
|
||||
|
@@ -12,7 +12,7 @@ source = smtp.message {
|
||||
headers = { ['content-type'] = 'multipart/alternative' },
|
||||
body = {
|
||||
[1] = {
|
||||
headers = { ['content-type'] = 'text/html' },
|
||||
headers = { ['Content-type'] = 'text/html' },
|
||||
body = "<html> <body> Hi, <b>there</b>...</body> </html>"
|
||||
},
|
||||
[2] = {
|
||||
@@ -60,7 +60,7 @@ source = smtp.message{
|
||||
-- chunks are loaded into memory and translation happens on the fly.
|
||||
[2] = {
|
||||
headers = {
|
||||
["content-type"] = 'image/png; name="luasocket.png"',
|
||||
["ConTenT-tYpE"] = 'image/png; name="luasocket.png"',
|
||||
["content-disposition"] = 'attachment; filename="luasocket.png"',
|
||||
["content-description"] = 'a beautiful image',
|
||||
["content-transfer-encoding"] = "BASE64"
|
||||
@@ -83,10 +83,10 @@ r, e = smtp.send{
|
||||
"<diego@princeton.edu>" },
|
||||
from = "<diego@princeton.edu>",
|
||||
source = ltn12.source.chain(source, filter),
|
||||
server = "mail.cs.princeton.edu",
|
||||
--server = "localhost",
|
||||
--port = 2525
|
||||
port = 25
|
||||
--server = "mail.cs.princeton.edu",
|
||||
--port = 25
|
||||
server = "localhost",
|
||||
port = 2525
|
||||
}
|
||||
|
||||
print(r, e)
|
||||
|
Reference in New Issue
Block a user