Added extra parameter for specifying extra HTTP response headers

This commit is contained in:
Luca Deri 2021-10-27 10:10:40 +02:00
parent 380b176c48
commit b2c437a641

View file

@ -135,11 +135,12 @@ function rest_utils.extended_answer(ret_const, payload, additional_response_para
print(rest_utils.rc(ret_const, payload, additional_response_param, format))
end
function rest_utils.vanilla_payload_response(ret_const, payload, content_type)
function rest_utils.vanilla_payload_response(ret_const, payload, content_type, extra_headers)
if content_type == nil then
content_type = "text/plain"
end
sendHTTPHeader(content_type, nil, {}, ret_const.http_code)
if(extra_headers == nil) then extra_headers = {} end
sendHTTPHeader(content_type, nil, extra_headers, ret_const.http_code)
print(payload)
end