mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
fix: replace image/* wildcard with explicit supported types in file picker
The image/* accept attribute allowed users to select BMP, TIFF, HEIC, and other image types that are rejected server-side. Replace with the exact set of supported image MIME types and extensions to match the copilot upload validation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -111,7 +111,21 @@ export const ACCEPTED_FILE_EXTENSIONS = SUPPORTED_DOCUMENT_EXTENSIONS.map((ext)
|
||||
|
||||
export const ACCEPT_ATTRIBUTE = [...ACCEPTED_FILE_TYPES, ...ACCEPTED_FILE_EXTENSIONS].join(',')
|
||||
|
||||
export const CHAT_ACCEPT_ATTRIBUTE = [ACCEPT_ATTRIBUTE, 'image/*'].join(',')
|
||||
const SUPPORTED_IMAGE_MIME_TYPES = [
|
||||
'image/jpeg',
|
||||
'image/png',
|
||||
'image/gif',
|
||||
'image/webp',
|
||||
'image/svg+xml',
|
||||
]
|
||||
|
||||
const SUPPORTED_IMAGE_EXTENSIONS = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg']
|
||||
|
||||
export const CHAT_ACCEPT_ATTRIBUTE = [
|
||||
ACCEPT_ATTRIBUTE,
|
||||
...SUPPORTED_IMAGE_MIME_TYPES,
|
||||
...SUPPORTED_IMAGE_EXTENSIONS,
|
||||
].join(',')
|
||||
|
||||
export interface FileValidationError {
|
||||
code: 'UNSUPPORTED_FILE_TYPE' | 'MIME_TYPE_MISMATCH'
|
||||
|
||||
Reference in New Issue
Block a user