parent
87c5c69c87
commit
57d994db0c
4 changed files with 54 additions and 4 deletions
|
|
@ -20,6 +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_BROWSERSAFE } from '@/const';
|
||||
|
||||
const logger = driveLogger.createSubLogger('register', 'yellow');
|
||||
|
||||
|
|
@ -241,6 +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_BROWSERSAFE.includes(type)) type = 'application/octet-stream';
|
||||
|
||||
const meta = await fetchMeta();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue