From 0dc3aed4fe589cfafa429cbc206b807f0e105596 Mon Sep 17 00:00:00 2001 From: juzeon <812312770@qq.com> Date: Sat, 25 Feb 2023 21:25:34 +0800 Subject: [PATCH] =?UTF-8?q?fix=E6=89=A9=E5=B1=95=E5=90=8D=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E4=B8=BA=E5=A4=A7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/util/util.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/util/util.go b/pkg/util/util.go index adfbc73..c28e1b3 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -3,10 +3,11 @@ package util import ( "errors" "path/filepath" + "strings" ) func ValidateFilename(filename string) error { - switch filepath.Ext(filename) { + switch filepath.Ext(strings.ToLower(filename)) { case ".pdf", ".doc", ".jpg", ".gif", ".png", ".jpeg", ".docx", ".xls", ".xlsx", ".zip", ".rar", ".7z", ".txt": return nil