mirror of
https://github.com/lxsang/silk.git
synced 2024-12-26 12:58:22 +01:00
fix: mime detection bug
All checks were successful
gitea-sync/silk/pipeline/head This commit looks good
All checks were successful
gitea-sync/silk/pipeline/head This commit looks good
This commit is contained in:
parent
afd9ffaa07
commit
de2ede07e2
@ -91,7 +91,7 @@ function Router:delegate()
|
|||||||
data.controller.main = true
|
data.controller.main = true
|
||||||
views.__main__ = self:call(data)
|
views.__main__ = self:call(data)
|
||||||
if not views.__main__ then
|
if not views.__main__ then
|
||||||
self:info("No view available for action: %s:%s", data.controller.class, data.action)
|
self:debug("No view available for action: %s:%s", data.controller.class, data.action)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
-- get all visible routes
|
-- get all visible routes
|
||||||
|
@ -43,11 +43,15 @@ function std.extra_mime(name)
|
|||||||
local ext = utils.ext(name)
|
local ext = utils.ext(name)
|
||||||
local mpath = __ROOT__ .. "/" .. "mimes.json"
|
local mpath = __ROOT__ .. "/" .. "mimes.json"
|
||||||
if WWW_ROOT and not ulib.exists(mpath) then
|
if WWW_ROOT and not ulib.exists(mpath) then
|
||||||
local mpath = WWW_ROOT .. "/" .. "mimes.json"
|
LOG_DEBUG("No extra mimes found in %s", mpath)
|
||||||
|
mpath = WWW_ROOT .. "/" .. "mimes.json"
|
||||||
|
LOG_DEBUG("Trying to looking for extra mimes in: %s", mpath)
|
||||||
end
|
end
|
||||||
local xmimes = {}
|
local xmimes = {}
|
||||||
if ulib.exists(mpath) then
|
if ulib.exists(mpath) then
|
||||||
xmimes = JSON.decodeFile(mpath)
|
xmimes = JSON.decodeFile(mpath)
|
||||||
|
else
|
||||||
|
LOG_DEBUG("No extra mimes")
|
||||||
end
|
end
|
||||||
if (name:find("Makefile$")) then
|
if (name:find("Makefile$")) then
|
||||||
return "text/makefile", false
|
return "text/makefile", false
|
||||||
|
Loading…
Reference in New Issue
Block a user