From 9d2fc8dad7a020229169e87cfd76213e10a2ec35 Mon Sep 17 00:00:00 2001 From: zer0Black Date: Fri, 9 Jun 2023 18:16:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=BB=E6=84=8F=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0windows=E7=9A=84&&DATA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=B5=81=E5=AE=89=E5=85=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jero/common/util/CommonUtils.java | 3 ++- .../src/main/resources/application-dev.yml | 2 +- .../src/main/resources/application-prod.yml | 2 +- .../src/main/resources/application-test.yml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java index a5ae9346..62c7f5d5 100644 --- a/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java +++ b/jero-boot/jero-boot-base/jero-boot-base-core/src/main/java/com/jero/common/util/CommonUtils.java @@ -253,7 +253,8 @@ public class CommonUtils { */ public static boolean limitFileSuffix(String fileName,String[] fileSuffixLimits){ final List fileNameList = Arrays.asList(fileSuffixLimits); - return fileNameList.stream().anyMatch(name -> fileName.substring(0,fileName.lastIndexOf('.')).contains(name)||fileName.substring(fileName.lastIndexOf('.')).equals(name)); + boolean isExists = fileNameList.stream().anyMatch(name -> fileName.substring(0,fileName.lastIndexOf('.')).contains(name)||fileName.substring(fileName.lastIndexOf('.')).contains(name)); + return isExists; } /** * RSA 使用私钥解密 diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml b/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml index b612269d..da2cc9d6 100644 --- a/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml +++ b/jero-boot/jero-boot-single-startup/src/main/resources/application-dev.yml @@ -270,7 +270,7 @@ jero: type: STANDALONE enabled: true # 文件限制后缀黑名单 - fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin + fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin,$DATA # 跨站白名单 whiteUrls: localhost:3000,localhost:8080 # xss白名单 diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/application-prod.yml b/jero-boot/jero-boot-single-startup/src/main/resources/application-prod.yml index e2bd1ee7..3a3b9ab7 100644 --- a/jero-boot/jero-boot-single-startup/src/main/resources/application-prod.yml +++ b/jero-boot/jero-boot-single-startup/src/main/resources/application-prod.yml @@ -271,7 +271,7 @@ jero: type: STANDALONE enabled: true # 文件限制后缀黑名单 - fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin + fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin,$DATA # 跨站白名单 whiteUrls: localhost:3000,localhost:8080 # xss白名单 diff --git a/jero-boot/jero-boot-single-startup/src/main/resources/application-test.yml b/jero-boot/jero-boot-single-startup/src/main/resources/application-test.yml index ed320023..f543d166 100644 --- a/jero-boot/jero-boot-single-startup/src/main/resources/application-test.yml +++ b/jero-boot/jero-boot-single-startup/src/main/resources/application-test.yml @@ -270,7 +270,7 @@ jero: type: STANDALONE enabled: true # 文件限制后缀黑名单 - fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin + fileSuffixLimits : 0x00,%00,\\00,.jsp,.exe,.php,.asp,.aspx,.jspx,.xml,.html,.js,.sh,.bin,$DATA # 跨站白名单 whiteUrls: localhost:3000,localhost:8080 # xss白名单