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:
parent
985eef6987
commit
b040aa1e78
2 changed files with 2 additions and 32 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue