forked from MrSyabro/lua_http_server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrules.lua
More file actions
21 lines (17 loc) · 932 Bytes
/
rules.lua
File metadata and controls
21 lines (17 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local function index(s)
s.request.url.path = "/index.lua"
end
return {
{regex = "rules.lua", func = index},
{regex = "pem", func = index},
{regex = "index$", func = index},
{regex = "files", func = function(s) s.url.path = "/files.lua" end},
{regex = "dump%-headers", func = function(s) s.request.url.path = "/dump-headers.lua" end},
{regex = "getfile", func = function(s) s.request.url.path = "/getfile.lua" end},
{regex = ".png", func = function(s) s.response.headers["Content-Type"] = "image/png" end},
{regex = ".ico", func = function(s) s.response.headers["Content-Type"] = "image/icon" end},
{regex = ".json", func = function(s) s.response.headers["Content-Type"] = "application/json" end},
{regex = ".svg", func = function(s) s.response.headers["Content-Type"] = "image/svg+xml" end},
{regex = ".css", func = function(s) s.response.headers["Content-Type"] = "image/css" end},
{regex = "/$", func = index},
}