fix: mime fetching bug of directory
All checks were successful
gitea-sync/antos-backend/pipeline/head This commit looks good

This commit is contained in:
DanyLE 2023-04-24 09:56:04 +02:00
parent 54a0a130b2
commit 4f697d0f70

View File

@ -57,7 +57,7 @@ vfs.fileinfo = function(vfspath)
end end
r.path = vfspath r.path = vfspath
r.name = utils.basename(vfspath) r.name = utils.basename(vfspath)
r.mime = std.mimeOf(r.name) r.mime = std.mimeOf(ospath)
return true, r return true, r
else else
return false, "Resource not found" return false, "Resource not found"
@ -240,7 +240,7 @@ vfs.readDir = function(vfspath)
end end
-- add extra mime type -- add extra mime type
for k, v in pairs(r) do for k, v in pairs(r) do
v.mime = std.mimeOf(v.filename) v.mime = std.mimeOf(ospath.."/"..v.filename)
end end
return r return r
end end