Added supporto for 4xx and 5xx returb codes in http_status_code.lua

This commit is contained in:
Luca Deri 2020-09-23 16:57:38 +02:00
parent ef4a357c4d
commit 97d456e020
2 changed files with 16 additions and 7 deletions

View file

@ -280,11 +280,12 @@ end
-- ##############################################
function sendHTTPContentTypeHeader(content_type, content_disposition, charset)
function sendHTTPContentTypeHeader(content_type, content_disposition, charset, extra_headers, status_code)
local charset = charset or "utf-8"
local mime = content_type.."; charset="..charset
sendHTTPHeader(mime, content_disposition)
tprint(status_code)
sendHTTPHeader(mime, content_disposition, extra_headers, status_code)
end