diff options
| author | ame <[email protected]> | 2026-06-12 00:56:21 -0500 |
|---|---|---|
| committer | ame <[email protected]> | 2026-06-12 00:56:21 -0500 |
| commit | 4ecdd3c18ccc5d3bcaa82ed720bf28443aa0ca9d (patch) | |
| tree | 0c263f51545c664dd1d818cf63f6912ef0e73837 /readme.md | |
| parent | 66aedfd65cff3494b70e8072646094479e3bfed8 (diff) | |
http body parsing rewrite
Diffstat (limited to 'readme.md')
| -rw-r--r-- | readme.md | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -9,11 +9,10 @@ heres an example of a webserver to return a [sha0](https://en.wikipedia.org/wiki <blockquote>
```lua
---(this is in tests/net2.lua)
+--(this is in tests/old/net2.lua)
net = require "lullaby.net"
crypto = require "lullaby.crypto"
local port = 8080
-MAX_LENGTH = 2048
net.listen(function(server)
@@ -21,8 +20,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()
|
