Skip to content

make status returning more consistent #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/wsapi/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function _M.send_error(out, err, msg, out_method, err_method, http_response)
local write_err = err[err_method or "write"]
write_err(err, "WSAPI error in application: " .. tostring(msg) .. "\n")
local msg = _M.error_html(msg)
local status, headers, res_iter = "500 Internal Server Error", {
local status, headers, res_iter = 500, {
["Content-Type"] = "text/html",
["Content-Length"] = #msg
}, make_iterator(msg)
Expand All @@ -250,7 +250,7 @@ end
function _M.send_404(out, msg, out_method, http_response)
local write = out[out_method or "write"]
local msg = _M.status_404_html(msg)
local status, headers, res_iter = "404 Not Found", {
local status, headers, res_iter = 404, {
["Content-Type"] = "text/html",
["Content-Length"] = #msg
}, make_iterator(msg)
Expand Down