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:
parent
e6a98116a9
commit
0fc228042b
1 changed files with 12 additions and 0 deletions
|
@ -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")
|
||||||
|
|
Loading…
Add table
Reference in a new issue