Update docs

This commit is contained in:
Alan Grainger
2026-10-07 18:04:57 +13:00
parent 7a9ff2e6ee
commit 172f247418
14 changed files with 243 additions and 37 deletions
+13
View File
@@ -18,6 +18,19 @@ export function isUploadableType (mimeType: string): boolean {
return type.startsWith('image/') || type.startsWith('video/')
}
// Extensions Immich stores as SVG, whatever media type the request declares
const REFUSED_EXTENSIONS = new Set(['svg', 'svgz'])
/**
* Whether a file with this name may be sent. The media type is the sender's
* claim and Immich types the stored asset by its extension, so the SVG rule
* has to hold on the name as well or `evil.svg` sent as `image/jpeg` gets in.
*/
export function isUploadableName (filename: string): boolean {
const extension = filename.split('.').pop()?.toLowerCase() || ''
return !REFUSED_EXTENSIONS.has(extension)
}
/*
Types for files a desktop browser reports with an empty or generic `File.type`: HEIC,
HEIF, camera RAW and some video containers. Immich types the asset by its