From ef7bfb11f79e97cd29322e464fa087dfd54a81c7 Mon Sep 17 00:00:00 2001 From: Aritro37 <85866469+Aritro37@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:52:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20SUB=5FSTORE=5FFRONT?= =?UTF-8?q?END=5FPATH=20=E4=BD=BF=E7=94=A8=E7=BB=9D=E5=AF=B9=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E5=89=8D=E7=AB=AF=E8=B5=84=E6=BA=90=20Conten?= =?UTF-8?q?t-Type=20=E5=93=8D=E5=BA=94=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/restful/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/restful/index.js b/backend/src/restful/index.js index 47a0ec6..5034d1e 100644 --- a/backend/src/restful/index.js +++ b/backend/src/restful/index.js @@ -76,9 +76,10 @@ export default function serve() { } const express_ = eval(`require("express")`); const mime_ = eval(`require("mime-types")`); + const path_ = eval(`require("path")`); const staticFileMiddleware = express_.static(fe_path, { setHeaders: (res, path) => { - const type = mime_.contentType(path); + const type = mime_.contentType(path_.extname(path)); if (type) { res.set('Content-Type', type); }