1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Fix video upload with a capitalized ext

This commit is contained in:
Chocobozzz 2021-06-08 09:33:03 +02:00
parent 2951065162
commit ea54cd04c1
No known key found for this signature in database
GPG key ID: 583A612D890159BE
10 changed files with 82 additions and 49 deletions

View 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