mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Fix event data check.
This commit is contained in:
parent
e4fe22233c
commit
4cc22fcc95
4 changed files with 8 additions and 10 deletions
|
|
@ -35,9 +35,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
let { url } = payload;
|
||||
|
||||
// Validate eventData is JSON
|
||||
const valid = eventData && typeof eventData === 'object' && !Array.isArray(eventData);
|
||||
|
||||
if (!valid) {
|
||||
if (eventData && !(typeof eventData === 'object' && !Array.isArray(eventData))) {
|
||||
return badRequest(res, 'Event Data must be in the form of a JSON Object.');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue