refactor
This commit is contained in:
@ -20,7 +20,7 @@ import { isDuplicateKeyValueError } from '@/misc/is-duplicate-key-value-error';
|
||||
import * as S3 from 'aws-sdk/clients/s3';
|
||||
import { getS3 } from './s3';
|
||||
import * as sharp from 'sharp';
|
||||
import { FILE_TYPE_WHITELIST } from '@/const';
|
||||
import { FILE_TYPE_BROWSERSAFE } from '@/const';
|
||||
|
||||
const logger = driveLogger.createSubLogger('register', 'yellow');
|
||||
|
||||
@ -242,7 +242,7 @@ export async function generateAlts(path: string, type: string, generateWeb: bool
|
||||
*/
|
||||
async function upload(key: string, stream: fs.ReadStream | Buffer, type: string, filename?: string) {
|
||||
if (type === 'image/apng') type = 'image/png';
|
||||
if (!FILE_TYPE_WHITELIST.includes(type)) type = 'application/octet-stream';
|
||||
if (!FILE_TYPE_BROWSERSAFE.includes(type)) type = 'application/octet-stream';
|
||||
|
||||
const meta = await fetchMeta();
|
||||
|
||||
|
Reference in New Issue
Block a user