提交 18a940bb authored 作者: zhanrongzhen's avatar zhanrongzhen

修复nginx lua 导入模块的问题

上级 77a62aec
......@@ -92,14 +92,14 @@ http {
local ext = string.match(filename, "%.([^%.]+)$")
local mime_type
local detect = require "detect_mime_by_magic"
local detect_module = require "detect_mime_by_magic"
if ext then
-- mime_type = get_mime_type(ext)
-- 有扩展名,用download下载
return ngx.exec("/download/" .. filename)
else
-- 无扩展名:用 Lua 魔数检测
mime_type = detect(filepath)
mime_type = detect_module.detect(filepath)
end
-- 3. 设置响应头
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论