diff --git a/pages/api/views/create.js b/pages/api/views/create.js index bc987ba9..36223329 100644 --- a/pages/api/views/create.js +++ b/pages/api/views/create.js @@ -18,6 +18,14 @@ export default async (req, res) => { return res.status(403).send({ decorator: "SERVER_CREATE_VIEW_INVALID_DATA", error: true }); } + if (filterBySource) { + try { + new URL(filterBySource); + } catch (e) { + return res.status(403).send({ decorator: "SERVER_CREATE_VIEW_INVALID_DATA", error: true }); + } + } + if (filterBySlateId) { const slate = await Data.getSlateById({ id: filterBySlateId }); if (!slate) {