mirror of
https://github.com/lxsang/silk.git
synced 2024-11-13 00:38:23 +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
|
||||
views.__main__ = self:call(data)
|
||||
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
|
||||
end
|
||||
-- get all visible routes
|
||||
|
@ -43,11 +43,15 @@ function std.extra_mime(name)
|
||||
local ext = utils.ext(name)
|
||||
local mpath = __ROOT__ .. "/" .. "mimes.json"
|
||||
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
|
||||
local xmimes = {}
|
||||
if ulib.exists(mpath) then
|
||||
xmimes = JSON.decodeFile(mpath)
|
||||
else
|
||||
LOG_DEBUG("No extra mimes")
|
||||
end
|
||||
if (name:find("Makefile$")) then
|
||||
return "text/makefile", false
|
||||
|
Loading…
Reference in New Issue
Block a user