From 009eb7d43d9582856c275ad3b16f7e3ff94209cc Mon Sep 17 00:00:00 2001 From: amelia squires Date: Wed, 16 Apr 2025 13:09:46 -0500 Subject: merge thingy --- tests/net2.lua | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 tests/net2.lua (limited to 'tests/net2.lua') diff --git a/tests/net2.lua b/tests/net2.lua deleted file mode 100644 index bb69051..0000000 --- a/tests/net2.lua +++ /dev/null @@ -1,24 +0,0 @@ ---(this is in tests/net2.lua) -net = require "lullaby.net" -local crypto = require "lullaby.crypto" -local port = 8080 -MAX_LENGTH = 2048 - -net.listen(function(server) - - --listen to post requests at localhost:8080 (root directory) - 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) - - --incremental hashes allow updating via addition, in this case adding the body and getting a string from it - hash = (hash + req.Body):final() - print(hash, crypto) - --send the hash to the client, closes connection, but thread is live until it ends - res:send(hash) - end) - -end, port) - -- cgit v1.2.3