mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 09:45:04 +01:00
Merge pull request #1945 from yumusb/patch-1
Fix "x-umami-cache: undefined"
This commit is contained in:
commit
71628bec90
@ -162,11 +162,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