aboutsummaryrefslogtreecommitdiff
path: root/tests/old
diff options
context:
space:
mode:
authorame <[email protected]>2026-06-12 00:56:21 -0500
committerame <[email protected]>2026-06-12 00:56:21 -0500
commit4ecdd3c18ccc5d3bcaa82ed720bf28443aa0ca9d (patch)
tree0c263f51545c664dd1d818cf63f6912ef0e73837 /tests/old
parent66aedfd65cff3494b70e8072646094479e3bfed8 (diff)
http body parsing rewrite
Diffstat (limited to 'tests/old')
-rw-r--r--tests/old/net2.lua8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/old/net2.lua b/tests/old/net2.lua
index bb69051..2398b63 100644
--- a/tests/old/net2.lua
+++ b/tests/old/net2.lua
@@ -1,8 +1,7 @@
---(this is in tests/net2.lua)
+--(this is in tests/old/net2.lua)
net = require "lullaby.net"
local crypto = require "lullaby.crypto"
local port = 8080
-MAX_LENGTH = 2048
net.listen(function(server)
@@ -10,8 +9,8 @@ net.listen(function(server)
server:POST("/", function(res, req)
--creates a sha0 hash object
local hash = crypto.sha0()
- --loads an extra 2048 characters from the request body (the body is not guaranteed to be >= 2048 characters, reasoning in docs)
- req:roll(MAX_LENGTH)
+
+ req:load()
--incremental hashes allow updating via addition, in this case adding the body and getting a string from it
hash = (hash + req.Body):final()
@@ -21,4 +20,3 @@ net.listen(function(server)
end)
end, port)
-