mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Fix issue with sendBeacon request.
This commit is contained in:
parent
48db7708de
commit
17790aa5a8
6 changed files with 23 additions and 22 deletions
|
|
@ -2,7 +2,7 @@ import isbot from 'isbot';
|
|||
import ipaddr from 'ipaddr.js';
|
||||
import { savePageView, saveEvent } from 'lib/queries';
|
||||
import { useCors, useSession } from 'lib/middleware';
|
||||
import { getIpAddress } from 'lib/request';
|
||||
import { getJsonBody, getIpAddress } from 'lib/request';
|
||||
import { ok, badRequest } from 'lib/response';
|
||||
import { createToken } from 'lib/crypto';
|
||||
import { removeTrailingSlash } from 'lib/url';
|
||||
|
|
@ -39,10 +39,11 @@ export default async (req, res) => {
|
|||
await useSession(req, res);
|
||||
|
||||
const {
|
||||
body: { type, payload },
|
||||
session: { website_id, session_id },
|
||||
} = req;
|
||||
|
||||
const { type, payload } = getJsonBody(req);
|
||||
|
||||
let { url, referrer, event_type, event_value } = payload;
|
||||
|
||||
if (process.env.REMOVE_TRAILING_SLASH) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue