mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-25 09:15:19 +03:00
feat(views/create): return error if filterBySource is invalid
This commit is contained in:
parent
2d3130840c
commit
4bced27f0c
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user