fix: headers

This commit is contained in:
Cory Dransfeldt 2024-03-25 10:25:21 -07:00
parent 8b3142cca7
commit 9cfc82c077
No known key found for this signature in database
4 changed files with 9 additions and 9 deletions

View file

@ -1,7 +1,6 @@
let ignore;
let url = `https://coryd.dev/api/event/?site=${encodeURIComponent(window.location.origin)}&page=${encodeURIComponent(window.location.pathname)}&lang=${encodeURIComponent(navigator.language)}&nav=${encodeURIComponent(navigator.userAgent)}`
if (window.localStorage && window.localStorage.getItem('ignore')) {
ignore = localStorage.getItem('ignore')
url = `${url}&ignore=${ignore}`
}
let ignore = window?.localStorage?.getItem('ignore')
let urlBase = 'https://coryd.dev/api/event/'
let params = `site=${encodeURIComponent(window.location.origin)}&page=${encodeURIComponent(window.location.pathname)}&lang=${encodeURIComponent(navigator.language)}&nav=${encodeURIComponent(navigator.userAgent)}`
let url = `${urlBase}?${params}`;
if (ignore) url = `${urlBase}?ignore=${ignore}&${params}`
if (!window.fathom) fetch(url).then(() => {}).catch(() => {});