feat: update fabfile
This commit is contained in:
@@ -133,11 +133,6 @@ func checkStaticFile(rootPath string) func(ctx fiber.Ctx) error {
|
||||
f = "index.html"
|
||||
}
|
||||
|
||||
ext := filepath.Ext(f)
|
||||
mime := mime.TypeByExtension(ext)
|
||||
log.Infof("admin mime type: %s %s", ext, mime)
|
||||
ctx.Set(fiber.HeaderContentType, mime)
|
||||
|
||||
checkFiles := []string{f, "index.html"}
|
||||
for _, checkFile := range checkFiles {
|
||||
filePath := filepath.Join(rootPath, checkFile)
|
||||
@@ -147,6 +142,13 @@ func checkStaticFile(rootPath string) func(ctx fiber.Ctx) error {
|
||||
log.Warnf("file not found: %s", filePath)
|
||||
continue
|
||||
}
|
||||
|
||||
ext := filepath.Ext(filePath)
|
||||
mime := mime.TypeByExtension(ext)
|
||||
|
||||
log.Infof("mime type: %s %s", ext, mime)
|
||||
ctx.Set(fiber.HeaderContentType, mime)
|
||||
|
||||
return ctx.SendFile(file)
|
||||
}
|
||||
return ctx.SendStatus(fiber.StatusNotFound)
|
||||
|
||||
Reference in New Issue
Block a user