local function sendHttpResponse(connection, data)
    connection:send("HTTP/1.1 200 OK\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-4\r\nContent-Length: " .. data:len() .. "\r\n\r\n" .. data)
end

return sendHttpResponse
local function sendHttpResponse(connection, data)
    connection:send("HTTP/1.1 200 OK\r\nAccess-Control-Allow-Origin: *\r\nConnection: close\r\nContent-Type: text/html; charset=ISO-8859-4\r\nContent-Length: " .. data:len() .. "\r\n\r\n" .. data)
end

return sendHttpResponse
Set CORS header in http response to allow calling the modules' API from web applications other than its built-in demo html
Set CORS header in http response to allow calling the modules' API from web applications other than its built-in demo html
