2023-07-14 23:46:45 (UTC-03:00)
Marcel Rodrigues <marcelgmr@gmail.com>
add content-length header
diff --git a/lib/ludweb/http.lua b/lib/ludweb/http.lua index 1c7327c..8fcd1aa 100644 --- a/lib/ludweb/http.lua +++ b/lib/ludweb/http.lua @@ -86,6 +86,7 @@ local function build_response(data, status, reason, cookies) reason = reason or "See Other" header = "Location: " .. data .. "\n" end + header = header .. "Content-Length: " .. #data .. "\n" header = header .. build_cookie_data(cookies) -- it's nice to provide a minimal error message by default if status ~= 200 and data == "" then