mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2025-01-19 01:31:34 +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
|
||||
if (!urls || !(urls instanceof Array)) {
|
||||
throw new ClientError('Missing "urls" property (array).')
|
||||
if (!Array.isArray(urls) || !urls.length || urls.some(url => !/^https?:\/\//.test(url))) {
|
||||
throw new ClientError('Bad request.')
|
||||
}
|
||||
|
||||
if (urls.length > maxFilesPerUpload) {
|
||||
|
Loading…
Reference in New Issue
Block a user