From 736cfc3a8d44a715393e1ca803f5a153f303fac4 Mon Sep 17 00:00:00 2001 From: Rafis Ganeyev Date: Mon, 7 Oct 2013 10:51:42 +0000 Subject: [PATCH] make status returning more consistent --- src/wsapi/common.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wsapi/common.lua b/src/wsapi/common.lua index e059a8c..9be7ded 100644 --- a/src/wsapi/common.lua +++ b/src/wsapi/common.lua @@ -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) @@ -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)