http-server: clearing stack after each request.
h3rald h3rald@h3rald.com
Thu, 30 Dec 2021 04:36:58 +0000
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
minpkg/lib/min_http.nim
→
minpkg/lib/min_http.nim
@@ -131,6 +131,9 @@ raiseInvalid("Response headers are not in a dictionary.")
var headers = newHttpHeaders() for k in items(i.keys(rawHeaders).qVal): headers[k.getString] = i.dget(rawHeaders, k.getString).getString + # clear stack + while i.stack.len > 0: + discard i.pop await req.respond(status.intVal.HttpCode, body.getString, headers) try: waitFor server.serve(port = port.intVal.Port, callback = handler, address = address.getString)