Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fix referrer lookup.

Mike Caoae772f048cb2
diff --git a/pages/api/send.ts b/pages/api/send.ts
index 232e631df..05901f920 100644
--- a/pages/api/send.ts
+++ b/pages/api/send.ts
@@ -117,7 +117,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
urlPath = '/';
}
- if (referrerPath.startsWith('http')) {
+ if (referrerPath?.startsWith('http')) {
const refUrl = new URL(referrer);
referrerPath = refUrl.pathname;
referrerQuery = refUrl.search.substring(1);