Fix end of line
This commit is contained in:
parent
a51a4d929b
commit
6d608af486
@ -6,14 +6,14 @@ local function getMimeType(ext)
|
|||||||
local gzip = false
|
local gzip = false
|
||||||
-- A few MIME types. Keep list short. If you need something that is missing, let's add it.
|
-- A few MIME types. Keep list short. If you need something that is missing, let's add it.
|
||||||
local mt = {css = "text/css", gif = "image/gif", html = "text/html", ico = "image/x-icon", jpeg = "image/jpeg", jpg = "image/jpeg", js = "application/javascript", json = "application/json", png = "image/png"}
|
local mt = {css = "text/css", gif = "image/gif", html = "text/html", ico = "image/x-icon", jpeg = "image/jpeg", jpg = "image/jpeg", js = "application/javascript", json = "application/json", png = "image/png"}
|
||||||
-- add comressed flag if file ends with gz
|
-- add comressed flag if file ends with gz
|
||||||
if ext:find("gz$") then
|
if ext:find("gz$") then
|
||||||
ext = ext:sub(1, -4)
|
ext = ext:sub(1, -4)
|
||||||
gzip = true
|
gzip = true
|
||||||
end
|
end
|
||||||
if mt[ext] then contentType = mt[ext] else contentType = "text/plain" end
|
if mt[ext] then contentType = mt[ext] else contentType = "text/plain" end
|
||||||
return {contentType = contentType, gzip = gzip }
|
return {contentType = contentType, gzip = gzip }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function sendHeader(connection, code, codeString, mimeType)
|
local function sendHeader(connection, code, codeString, mimeType)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user