1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-08 23:35:31 +02:00

fix(TLS): remove file type validation [EE-3672] (#7280)

This commit is contained in:
itsconquest 2022-07-21 16:25:23 +12:00 committed by GitHub
parent 985eef6987
commit b040aa1e78
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 32 deletions

View file

@ -22,22 +22,3 @@ export function withFileSize(fileValidation: FileSchema, maxSize: number) {
return file.size <= maxSize;
}
}
export function withFileType(
fileValidation: FileSchema,
fileTypes: File['type'][]
) {
return fileValidation.test(
'file-type',
'Selected file has unsupported format.',
validateFileType
);
function validateFileType(file?: File) {
if (!file) {
return true;
}
return fileTypes.includes(file.type);
}
}