mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 04:25:39 +01:00
Sanitize eventdata.
This commit is contained in:
parent
509739fc9a
commit
e6a6222088
3 changed files with 35 additions and 12 deletions
|
|
@ -10,17 +10,21 @@ export default async (req, res) => {
|
|||
|
||||
const { id: websiteUuid } = req.query;
|
||||
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE, false))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
if (req.method === 'GET') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const website = await getWebsite({ websiteUuid });
|
||||
|
||||
return ok(res, website);
|
||||
}
|
||||
|
||||
if (req.method === 'POST') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE, false))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
const { name, domain, owner, enableShareUrl, shareId } = req.body;
|
||||
const { accountUuid } = req.auth;
|
||||
|
||||
|
|
@ -58,6 +62,10 @@ export default async (req, res) => {
|
|||
}
|
||||
|
||||
if (req.method === 'DELETE') {
|
||||
if (!(await allowQuery(req, TYPE_WEBSITE, false))) {
|
||||
return unauthorized(res);
|
||||
}
|
||||
|
||||
await deleteWebsite(websiteUuid);
|
||||
|
||||
return ok(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue