]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/express-utils.ts
Fetch directly all video attributes for get API
[github/Chocobozzz/PeerTube.git] / server / helpers / express-utils.ts
index 010c6961a063573409c5e0829373ee8b9ea867ad..003e028189fc41c6a8d7a50667cb5bb36255448f 100644 (file)
@@ -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