mirror of
https://github.com/halo-dev/plugin-s3.git
synced 2025-10-17 07:43:54 +00:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
07127d7e54 | ||
![]() |
565d3cfcaa |
@@ -1 +1 @@
|
|||||||
version=1.5.0-SNAPSHOT
|
version=1.6.1-SNAPSHOT
|
||||||
|
@@ -21,7 +21,7 @@ public class UrlUtils {
|
|||||||
|
|
||||||
public static String findUrlSuffix(List<S3OsProperties.urlSuffixItem> urlSuffixList,
|
public static String findUrlSuffix(List<S3OsProperties.urlSuffixItem> urlSuffixList,
|
||||||
String fileName) {
|
String fileName) {
|
||||||
if (StringUtils.isBlank(fileName)) {
|
if (StringUtils.isBlank(fileName) || urlSuffixList == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
fileName = fileName.toLowerCase();
|
fileName = fileName.toLowerCase();
|
||||||
|
@@ -46,5 +46,10 @@ class UrlUtilsTest {
|
|||||||
String fileName5 = "";
|
String fileName5 = "";
|
||||||
String result5 = UrlUtils.findUrlSuffix(urlSuffixList, fileName5);
|
String result5 = UrlUtils.findUrlSuffix(urlSuffixList, fileName5);
|
||||||
assertNull(result5);
|
assertNull(result5);
|
||||||
|
|
||||||
|
// 测试urlSuffixList为null,期望返回null
|
||||||
|
String fileName6 = "example";
|
||||||
|
String result6 = UrlUtils.findUrlSuffix(null, fileName6);
|
||||||
|
assertNull(result6);
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user