|
|
@@ -32,9 +32,13 @@ public class ChannelValidateService {
|
|
|
return Result.fail(errMsg);
|
|
|
}
|
|
|
|
|
|
+ if (fileType == ObjectType.Any.getCode()) {
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
String contentType = ObjectType.getDescByCode(fileType).toLowerCase(Locale.ROOT);
|
|
|
String mediaType = FileType.getMediaType(file.getAbsolutePath());
|
|
|
- if (!contentType.equals(ObjectType.Other.getDesc()) && !mediaType.startsWith(contentType)) {
|
|
|
+ if (!mediaType.startsWith(contentType)) {
|
|
|
String errMsg = String.format("channel validate failed, the format of file is not %s", contentType);
|
|
|
return Result.fail(errMsg);
|
|
|
}
|