aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-05-21 09:53:03 +0200
committerChocobozzz <me@florianbigard.com>2019-05-21 09:53:03 +0200
commit820d79c8ac7ba144d9357320c49b85b980387d43 (patch)
treef17649eb67034e806c2889f3df3d56ea3c922029 /server
parent80b8ad2a7084c206efb194ddfbea13df860f0c5f (diff)
downloadPeerTube-820d79c8ac7ba144d9357320c49b85b980387d43.tar.gz
PeerTube-820d79c8ac7ba144d9357320c49b85b980387d43.tar.zst
PeerTube-820d79c8ac7ba144d9357320c49b85b980387d43.zip
Fix OGG bug with firefox
Diffstat (limited to 'server')
-rw-r--r--server/helpers/express-utils.ts13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/helpers/express-utils.ts b/server/helpers/express-utils.ts
index e0a1d56a5..00f3f198b 100644
--- a/server/helpers/express-utils.ts
+++ b/server/helpers/express-utils.ts
@@ -74,7 +74,18 @@ function createReqFiles (
74 }, 74 },
75 75
76 filename: async (req, file, cb) => { 76 filename: async (req, file, cb) => {
77 const extension = mimeTypes[ file.mimetype ] || extname(file.originalname) 77 let extension: string
78 const fileExtension = extname(file.originalname)
79 const extensionFromMimetype = mimeTypes[ file.mimetype ]
80
81 // Take the file extension if we don't understand the mime type
82 // We have the OGG/OGV exception too because firefox sends a bad mime type when sending an OGG file
83 if (fileExtension === '.ogg' || fileExtension === '.ogv' || !extensionFromMimetype) {
84 extension = fileExtension
85 } else {
86 extension = extensionFromMimetype
87 }
88
78 let randomString = '' 89 let randomString = ''
79 90
80 try { 91 try {