diff --git a/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java b/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java index e37503e8f2..deaeb6f034 100644 --- a/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java +++ b/linkis-public-enhancements/linkis-udf-service/src/main/java/org/apache/linkis/udf/api/UDFRestfulApi.java @@ -16,8 +16,7 @@ */ package org.apache.linkis.udf.api; - -import org.apache.commons.lang3.StringUtils; +import org.springframework.util.StringUtils; import org.apache.linkis.common.conf.Configuration; import org.apache.linkis.common.io.FsPath; import org.apache.linkis.server.Message; @@ -1448,7 +1447,7 @@ public Message pythonUpload( public Message getRegisterFunctions(HttpServletRequest req, @RequestParam("path") String path) throws IOException { // 使用正则校验path,防止命令注入漏洞 - if (StringUtils.isBlank(path) || !path.matches("^[a-zA-Z0-9_.-/:]+$")) { + if (StringUtils.isEmpty(path) || !path.matches("^[a-zA-Z0-9_.-/:]+$")) { return Message.error("path参数格式错误"); } if (StringUtils.endsWithIgnoreCase(path, Constants.FILE_EXTENSION_PY)