mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 09:41:33 +00:00
fix: improve url uploads input check
This commit is contained in:
parent
7e28c26d41
commit
d364034738
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user