refactor: Upgrade to mime 4.0.4 (#9363)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { GraphQLNonNull } from 'graphql';
|
||||
import { request } from 'http';
|
||||
import { getExtension } from 'mime';
|
||||
import { mutationWithClientMutationId } from 'graphql-relay';
|
||||
import Parse from 'parse/node';
|
||||
import * as defaultGraphQLTypes from './defaultGraphQLTypes';
|
||||
@@ -17,8 +16,9 @@ const handleUpload = async (upload, config) => {
|
||||
delete headers['host'];
|
||||
delete headers['content-length'];
|
||||
const stream = createReadStream();
|
||||
const mime = (await import('mime')).default;
|
||||
try {
|
||||
const ext = getExtension(mimetype);
|
||||
const ext = mime.getExtension(mimetype);
|
||||
const fullFileName = filename.endsWith(`.${ext}`) ? filename : `${filename}.${ext}`;
|
||||
const serverUrl = new URL(config.serverURL);
|
||||
const fileInfo = await new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user