1
1
Fork 0
mirror of https://github.com/lune-org/lune.git synced 2025-04-20 11:53:50 +01:00

Add a test for malformed IP

This commit is contained in:
Marin Minnerly 2024-01-15 12:18:03 -08:00
parent e6a98116a9
commit 0fc228042b

View file

@ -96,3 +96,15 @@ local response3 = net.request(`{URL_EXTERNAL}:{PORT}`).body
assert(response3 ~= nil, "Invalid response from server") assert(response3 ~= nil, "Invalid response from server")
handle2.stop() handle2.stop()
-- Attempting to serve with a malformed IP address should throw an error
local success3 = pcall(function()
net.serve(8080, {
address = "a.b.c.d",
handleRequest = function()
return RESPONSE
end,
})
end)
assert(not success3, "Server was created with malformed address")