diff options
Diffstat (limited to 'server/helpers/express-utils.ts')
-rw-r--r-- | server/helpers/express-utils.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts index 010c6961a..003e02818 100644 --- a/server/helpers/express-utils.ts +++ b/server/helpers/express-utils.ts | |||
@@ -1,9 +1,9 @@ | |||
1 | import * as express from 'express' | 1 | import * as express from 'express' |
2 | import * as multer from 'multer' | 2 | import * as multer from 'multer' |
3 | import { extname } from 'path' | ||
4 | import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' | 3 | import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' |
5 | import { CONFIG } from '../initializers/config' | 4 | import { CONFIG } from '../initializers/config' |
6 | import { REMOTE_SCHEME } from '../initializers/constants' | 5 | import { REMOTE_SCHEME } from '../initializers/constants' |
6 | import { getLowercaseExtension } from './core-utils' | ||
7 | import { isArray } from './custom-validators/misc' | 7 | import { isArray } from './custom-validators/misc' |
8 | import { logger } from './logger' | 8 | import { logger } from './logger' |
9 | import { deleteFileAndCatch, generateRandomString } from './utils' | 9 | import { deleteFileAndCatch, generateRandomString } from './utils' |
@@ -79,7 +79,7 @@ function createReqFiles ( | |||
79 | 79 | ||
80 | filename: async (req, file, cb) => { | 80 | filename: async (req, file, cb) => { |
81 | let extension: string | 81 | let extension: string |
82 | const fileExtension = extname(file.originalname) | 82 | const fileExtension = getLowercaseExtension(file.originalname) |
83 | const extensionFromMimetype = getExtFromMimetype(mimeTypes, file.mimetype) | 83 | const extensionFromMimetype = getExtFromMimetype(mimeTypes, file.mimetype) |
84 | 84 | ||
85 | // Take the file extension if we don't understand the mime type | 85 | // Take the file extension if we don't understand the mime type |