X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Fvideos%2Fvideo-imports.ts;h=d0643ff26e8935648913643ef5c0b5a9330a25f7;hb=32985a0a779e0e2100a3990b1f1188645e58dfb1;hp=c53af38613e7bc068ccf8fe76666e34d86900f70;hpb=a3c997b34cad79fce92c67951a3c8140a9888973;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/videos/video-imports.ts b/server/middlewares/validators/videos/video-imports.ts index c53af3861..d0643ff26 100644 --- a/server/middlewares/validators/videos/video-imports.ts +++ b/server/middlewares/validators/videos/video-imports.ts @@ -47,14 +47,12 @@ const videoImportAddValidator = getCommonVideoEditAttributes().concat([ cleanUpReqFiles(req) return res.status(HttpStatusCode.CONFLICT_409) .json({ error: 'HTTP import is not enabled on this instance.' }) - .end() } if (CONFIG.IMPORT.VIDEOS.TORRENT.ENABLED !== true && (req.body.magnetUri || torrentFile)) { cleanUpReqFiles(req) return res.status(HttpStatusCode.CONFLICT_409) .json({ error: 'Torrent/magnet URI import is not enabled on this instance.' }) - .end() } if (!await doesVideoChannelOfAccountExist(req.body.channelId, user, res)) return cleanUpReqFiles(req) @@ -65,7 +63,6 @@ const videoImportAddValidator = getCommonVideoEditAttributes().concat([ return res.status(HttpStatusCode.BAD_REQUEST_400) .json({ error: 'Should have a magnetUri or a targetUrl or a torrent file.' }) - .end() } if (!await isImportAccepted(req, res)) return cleanUpReqFiles(req)