mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 12:35:38 +01:00
remove event_data.
This commit is contained in:
parent
4cb5a14de9
commit
0cc1319e14
19 changed files with 29 additions and 627 deletions
|
|
@ -31,19 +31,9 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
|
||||
const { type, payload } = getJsonBody(req);
|
||||
|
||||
const { referrer, eventName, eventData } = payload;
|
||||
const { referrer, eventName } = payload;
|
||||
let { url } = payload;
|
||||
|
||||
// Validate eventData is JSON
|
||||
if (eventData && !(typeof eventData === 'object' && !Array.isArray(eventData))) {
|
||||
return badRequest(res, 'Event Data must be in the form of a JSON Object.');
|
||||
}
|
||||
|
||||
// Validate eventData is less than 100kB
|
||||
if (eventData && new TextEncoder().encode(eventData).length / 1024 > 100) {
|
||||
return badRequest(res, 'Event Data exceeds maximum size of 100 kB.');
|
||||
}
|
||||
|
||||
const ignoreIps = process.env.IGNORE_IP;
|
||||
const ignoreHostnames = process.env.IGNORE_HOSTNAME;
|
||||
|
||||
|
|
@ -102,7 +92,6 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
url,
|
||||
referrer,
|
||||
eventName,
|
||||
eventData,
|
||||
});
|
||||
} else {
|
||||
return badRequest(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue