remove timeout

This commit is contained in:
William Bell committed 2023-07-17 17:22:23 +01:00
1 parent 4ec96d68f0
commit 23b730d533
2 files changed
+2 -4

No files matched your search

+2 -2
View File
@@ -1,5 +1,5 @@
let __multipart(req, res) = do
let boundary = buffer().from(req.headers["Content-Type"].split("boundary=")[1])
let boundary = buffer().from(req.headers["Content-Type"].splitN("boundary=")[1])
let newLineSplit = buffer().from("\r\n\r\n")
let parts = req.buffer.body.split(boundary)
for (i from 0 to parts.length) do
@@ -27,7 +27,7 @@ let __multipart(req, res) = do
req.files[name].data = body
let save(path) = do
let file = file.write(path)
file.write(body)
file.buffer(body)
file.close()
req.files[name].save = save
else do
-2
View File
@@ -4,7 +4,6 @@ let readChunkSize = 1024^2
let methodsWithBody = ["POST", "PUT", "PATCH"]
let parse(conn) = do
conn.setTimeout(10000)
let headerData = conn.readUntil(buffer().from("\r\n\r\n"))
let inBody = false
let split = headerData.to("string").split("\r\n")
@@ -33,5 +32,4 @@ let parse(conn) = do
catch (e) do
term.log(e)
break
conn.clearTimeout()
return {method: method, path: path, version: version, headers: headers, buffer: {header: headerData, body: body}}