Send raw JSON.

This commit is contained in:
Mike Cao 2020-07-18 03:44:54 -07:00
parent 631d124a61
commit bb04015b46
3 changed files with 4 additions and 4 deletions

View file

@ -62,7 +62,7 @@ export async function getCountry(req, ip) {
export async function parseSessionRequest(req) {
const ip = getIpAddress(req);
const { website_id, screen, language } = JSON.parse(req.body);
const { website_id, screen, language } = req.body;
const { userAgent, browser, os } = getDevice(req);
const country = await getCountry(req, ip);
const session_id = hash(`${website_id}${ip}${userAgent}${os}`);
@ -79,7 +79,7 @@ export async function parseSessionRequest(req) {
}
export function parseCollectRequest(req) {
const { type, payload } = JSON.parse(req.body);
const { type, payload } = req.body;
if (payload.session) {
const {