mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-22 01:03:39 +01:00
Send raw JSON.
This commit is contained in:
parent
631d124a61
commit
bb04015b46
@ -18,7 +18,7 @@ export default function Layout({ title, children }) {
|
||||
async
|
||||
defer
|
||||
data-website-id="865234ad-6a92-11e7-8846-b05adad3f099"
|
||||
src="http://umami.is/umami.js"
|
||||
src="/umami.js"
|
||||
/>
|
||||
)}
|
||||
</Head>
|
||||
|
@ -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 {
|
||||
|
@ -18,7 +18,7 @@ function post(url, params) {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify(params),
|
||||
body: params,
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user