Merge pull request #5 from auravoid/main
Fix error when PLAUSIBLE_HOST is missing
This commit is contained in:
commit
91f42a9eab
1 changed files with 1 additions and 1 deletions
2
index.js
2
index.js
|
|
@ -62,7 +62,7 @@ async function handleRequest(event) {
|
||||||
} else {
|
} else {
|
||||||
// PLAUSIBLE_HOST should be the full URL to your Plausible Analytics instance
|
// PLAUSIBLE_HOST should be the full URL to your Plausible Analytics instance
|
||||||
// e.g. https://plausible.io/
|
// e.g. https://plausible.io/
|
||||||
if (PLAUSIBLE_HOST !== undefined) {
|
if (typeof PLAUSIBLE_HOST !== 'undefined') {
|
||||||
const url = PLAUSIBLE_HOST + 'api/event'
|
const url = PLAUSIBLE_HOST + 'api/event'
|
||||||
const headers = new Headers()
|
const headers = new Headers()
|
||||||
headers.append('User-Agent', request.headers.get('User-Agent'))
|
headers.append('User-Agent', request.headers.get('User-Agent'))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue