From 1ae9eb53879739564d521a4db2681e7ed5aac0dd Mon Sep 17 00:00:00 2001 From: aura <32175146+auravoid@users.noreply.github.com> Date: Fri, 23 Dec 2022 22:59:10 -0500 Subject: [PATCH] Fix error when PLAUSIBLE_HOST is missing --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fe12a53..dad7337 100644 --- a/index.js +++ b/index.js @@ -62,7 +62,7 @@ async function handleRequest(event) { } else { // PLAUSIBLE_HOST should be the full URL to your Plausible Analytics instance // e.g. https://plausible.io/ - if (PLAUSIBLE_HOST !== undefined) { + if (typeof PLAUSIBLE_HOST !== 'undefined') { const url = PLAUSIBLE_HOST + 'api/event' const headers = new Headers() headers.append('User-Agent', request.headers.get('User-Agent'))