mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
fix(console): allow image/x-icon mime type (#5193)
This commit is contained in:
parent
2b273b4a6f
commit
06c5795181
4 changed files with 9 additions and 3 deletions
|
@ -9,6 +9,7 @@ export const mimeTypeToFileExtensionMappings: MimeTypeToFileExtensionMappings =
|
|||
'image/png': ['png'],
|
||||
'image/gif': ['gif'],
|
||||
'image/vnd.microsoft.icon': ['ico'],
|
||||
'image/x-icon': ['ico'],
|
||||
'image/svg+xml': ['svg'],
|
||||
'image/tiff': ['tif', 'tiff'],
|
||||
'image/webp': ['webp'],
|
||||
|
|
|
@ -11,6 +11,7 @@ const allowedImageMimeTypes: AllowedUploadMimeType[] = [
|
|||
'image/png',
|
||||
'image/jpeg',
|
||||
'image/vnd.microsoft.icon',
|
||||
'image/x-icon',
|
||||
];
|
||||
|
||||
const useImageMimeTypes = (
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
import type { AllowedUploadMimeType } from '@logto/schemas';
|
||||
import { deduplicate } from '@silverhand/essentials';
|
||||
|
||||
import { mimeTypeToFileExtensionMappings } from '@/consts/user-assets';
|
||||
|
||||
export const convertToFileExtensionArray = (mimeTypes: AllowedUploadMimeType[]) =>
|
||||
deduplicate(
|
||||
mimeTypes
|
||||
.flatMap((type) => mimeTypeToFileExtensionMappings[type])
|
||||
.map((extension) => extension.toUpperCase());
|
||||
.map((extension) => extension.toUpperCase())
|
||||
);
|
||||
|
|
|
@ -8,6 +8,7 @@ export const allowUploadMimeTypes = [
|
|||
'image/png',
|
||||
'image/gif',
|
||||
'image/vnd.microsoft.icon',
|
||||
'image/x-icon',
|
||||
'image/svg+xml',
|
||||
'image/tiff',
|
||||
'image/webp',
|
||||
|
|
Loading…
Reference in a new issue