all repos — min @ 719f6f7527b68403efb92e4090b705e56f5af996

A small but practical concatenative programming language.

http-server: clearing stack after each request.
h3rald h3rald@h3rald.com
Thu, 30 Dec 2021 04:36:58 +0000
commit

719f6f7527b68403efb92e4090b705e56f5af996

parent

15464b360485c9f905f2c6474e976ab8803c3b0a

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M minpkg/lib/min_http.nimminpkg/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)