about summary refs log tree commit diff stats
path: root/src/loader/cgi.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-05-11 19:56:25 +0200
committerbptato <nincsnevem662@gmail.com>2024-05-11 20:06:10 +0200
commitb8345d19efdecb27139e011e92f89efbb7618c08 (patch)
tree5d0f3de089ef40f1f653ee386771e326f9847cd6 /src/loader/cgi.nim
parent2c1d1899e424c5e055214d3647979f7f0ba4dcfe (diff)
downloadchawan-b8345d19efdecb27139e011e92f89efbb7618c08.tar.gz
buffer: fix multipart forms
* fix enctype not getting picked up
* fix form data constructor requiring open() syscall (which gets blocked
  by our seccomp filter)
* add closing boundary to multipart end
* pass fds instead of path names through WebFile/Blob and send those
  through bufwriter/bufreader
Diffstat (limited to 'src/loader/cgi.nim')
-rw-r--r--src/loader/cgi.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/loader/cgi.nim b/src/loader/cgi.nim
index 2c395e95..347855ac 100644
--- a/src/loader/cgi.nim
+++ b/src/loader/cgi.nim
@@ -229,6 +229,7 @@ proc loadCGI*(handle: LoaderHandle; request: Request; cgiDir: seq[string];
         let multipart = request.multipart.get
         for entry in multipart.entries:
           ps.writeEntry(entry, multipart.boundary)
+        ps.writeEnd(multipart.boundary)
       ps.sclose()
     handle.parser = HeaderParser(headers: newHeaders())
     handle.istream = newPosixStream(pipefd[0])