Skip to content

Commit 729bed4

Browse files
J-MichalekJakub
andauthored
fix(FileUpload): handle wildcard in dropzone dataTypes (#4671)
Co-authored-by: Jakub <[email protected]>
1 parent a90b19b commit 729bed4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/runtime/composables/useFileUpload.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@ function parseAcceptToDataTypes(accept: string): string[] | undefined {
2222

2323
const types = accept
2424
.split(',')
25-
.map(type => type.trim())
25+
.map((type) => {
26+
const trimmedType = type.trim()
27+
28+
if (trimmedType.includes('/') && trimmedType.endsWith('/*')) {
29+
return trimmedType.split('/')[0] || trimmedType
30+
}
31+
return trimmedType
32+
})
2633
.filter((type) => {
2734
return !type.startsWith('.')
2835
})

0 commit comments

Comments
 (0)