X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fexpress-utils.ts;h=003e028189fc41c6a8d7a50667cb5bb36255448f;hb=ca4b4b2e5590c1b37cff1fe1be7f797b93351229;hp=010c6961a063573409c5e0829373ee8b9ea867ad;hpb=1e4d2cb5aef11898585fae4053da4ebd0a69b480;p=github%2FChocobozzz%2FPeerTube.git 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 @@ import * as express from 'express' import * as multer from 'multer' -import { extname } from 'path' import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes' import { CONFIG } from '../initializers/config' import { REMOTE_SCHEME } from '../initializers/constants' +import { getLowercaseExtension } from './core-utils' import { isArray } from './custom-validators/misc' import { logger } from './logger' import { deleteFileAndCatch, generateRandomString } from './utils' @@ -79,7 +79,7 @@ function createReqFiles ( filename: async (req, file, cb) => { let extension: string - const fileExtension = extname(file.originalname) + const fileExtension = getLowercaseExtension(file.originalname) const extensionFromMimetype = getExtFromMimetype(mimeTypes, file.mimetype) // Take the file extension if we don't understand the mime type