From f776ebf34442e0ac6dfc46afd5ac47793db82ac3 Mon Sep 17 00:00:00 2001 From: amelia squires Date: Wed, 11 Sep 2024 00:02:08 -0500 Subject: add res:stop --- docs/net.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/net.md b/docs/net.md index e548cb1..9b85c18 100644 --- a/docs/net.md +++ b/docs/net.md @@ -48,13 +48,13 @@ the actual name of the function will change based on what request method you wan ```lua server:all("*", function(res, req) if(req['Version'] ~= "HTTP/1.1") then - res:close() + res:stop() end end) ... server:GET("/", function(res, req) - --version will always be 1.1, as per the middleware + --version will always be 1.1, because the request passes through the function sequentially ... end) ... @@ -69,7 +69,7 @@ end) 'takes a string sends the string to the client, constructs a header on first call (whether or not res.header._sent is null) -(the constructed header can not be changed later on in the request), and sends the string without closing the client +(the constructed header can not be changed later on in the request*), and sends the string without closing the client ```lua ... @@ -78,6 +78,8 @@ res:write("

good bye world

") ... ``` +*well it can but it wont do anything + #### res:send 'takes a string @@ -94,6 +96,12 @@ res:send("

hello world

") closes connection, sets res.client_fd to -1, any calls that use this value will fail +this will still run any selected functions! + +#### res:stop + +prevents all further selected functions from running + #### res.header table containing all head information, anything added to it will be used, certain keys will affect other values or have other side effects on res:send, listed below -- cgit v1.2.3