X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fvalidators%2Foembed.ts;h=c89bc26de8ae24ce2275971bdefee5bbd33f33ac;hb=2ba92871319d7af63472c1380664a9f9eeb1c690;hp=31f06dc65e9f747ecfbd19d70726b5fb879ba88a;hpb=a2431b7dcbc72c05101dcdbe631ff84a823aeb51;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/validators/oembed.ts b/server/middlewares/validators/oembed.ts index 31f06dc65..c89bc26de 100644 --- a/server/middlewares/validators/oembed.ts +++ b/server/middlewares/validators/oembed.ts @@ -1,10 +1,12 @@ import * as express from 'express' import { query } from 'express-validator/check' import { join } from 'path' -import { isIdOrUUIDValid, isTestInstance, logger } from '../../helpers' +import { isTestInstance } from '../../helpers/core-utils' +import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc' +import { doesVideoExist } from '../../helpers/custom-validators/videos' +import { logger } from '../../helpers/logger' import { CONFIG } from '../../initializers' import { areValidationErrors } from './utils' -import { isVideoExist } from '../../helpers/custom-validators/videos' const urlShouldStartWith = CONFIG.WEBSERVER.SCHEME + '://' + join(CONFIG.WEBSERVER.HOST, 'videos', 'watch') + '/' const videoWatchRegex = new RegExp('([^/]+)$') @@ -50,7 +52,7 @@ const oembedValidator = [ .end() } - if (!await isVideoExist(videoId, res)) return + if (!await doesVideoExist(videoId, res)) return return next() }