mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-24 02:06:19 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
commit
80438bf84c
@ -168,11 +168,16 @@
|
||||
|
||||
const send = payload => {
|
||||
if (trackingDisabled()) return;
|
||||
|
||||
const headers = {
|
||||
'Content-Type': 'application/json'
|
||||
};
|
||||
if (typeof cache !== 'undefined') {
|
||||
headers['x-umami-cache'] = cache;
|
||||
}
|
||||
return fetch(endpoint, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ type: 'event', payload }),
|
||||
headers: { 'Content-Type': 'application/json', ['x-umami-cache']: cache },
|
||||
headers: headers
|
||||
})
|
||||
.then(res => res.text())
|
||||
.then(text => (cache = text));
|
||||
|
Loading…
Reference in New Issue
Block a user