fix: improve url uploads input check

This commit is contained in:
Bobby 2022-09-28 11:37:29 +07:00
parent 7e28c26d41
commit d364034738
No known key found for this signature in database
GPG Key ID: 941839794CBF5A09

View File

@ -551,8 +551,8 @@ self.actuallyUploadUrls = async (req, res, data = {}) => {
} }
const urls = req.body.urls const urls = req.body.urls
if (!urls || !(urls instanceof Array)) { if (!Array.isArray(urls) || !urls.length || urls.some(url => !/^https?:\/\//.test(url))) {
throw new ClientError('Missing "urls" property (array).') throw new ClientError('Bad request.')
} }
if (urls.length > maxFilesPerUpload) { if (urls.length > maxFilesPerUpload) {