mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
remove event_data. (#1804)
This commit is contained in:
parent
94165ca5ad
commit
82f0bc3d2b
21 changed files with 29 additions and 629 deletions
|
|
@ -34,19 +34,9 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
|
||||
const { type, payload } = getJsonBody(req);
|
||||
|
||||
const { referrer, eventName, eventData, pageTitle } = payload;
|
||||
const { referrer, eventName, pageTitle } = 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;
|
||||
|
||||
|
|
@ -106,7 +96,6 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
|
|||
referrer,
|
||||
pageTitle,
|
||||
eventName,
|
||||
eventData,
|
||||
});
|
||||
} else {
|
||||
return badRequest(res);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue