Fix issue with sendBeacon request.
This commit is contained in:
@@ -86,3 +86,11 @@ export async function getClientInfo(req, { screen }) {
|
||||
|
||||
return { userAgent, browser, os, ip, country, device };
|
||||
}
|
||||
|
||||
export function getJsonBody(req) {
|
||||
if (req.headers['content-type'].indexOf('text/plain') !== -1) {
|
||||
return JSON.parse(req.body);
|
||||
}
|
||||
|
||||
return req.body;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user