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.

Should allow non http referrers. Closes #2831

Mike Cao082a751ffec8
diff --git a/src/pages/api/send.ts b/src/pages/api/send.ts
index 3431795ed..313184202 100644
--- a/src/pages/api/send.ts
+++ b/src/pages/api/send.ts
@@ -121,7 +121,7 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => {
urlPath = '/';
}
- if (referrerPath?.startsWith('http')) {
+ if (/^[\w-]+:\/\/\w+/.test(referrerPath)) {
const refUrl = new URL(referrer);
referrerPath = refUrl.pathname;
referrerQuery = refUrl.search.substring(1);