From 8751dd5e91a106f236c0335f67348d91fd0ee7fa Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Sun, 4 Apr 2021 20:18:31 -0700 Subject: [PATCH] Explicity send no referrer headers to external requests for privacy --- web/utils/apis.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/utils/apis.ts b/web/utils/apis.ts index c737a0826..88bb7a063 100644 --- a/web/utils/apis.ts +++ b/web/utils/apis.ts @@ -118,7 +118,10 @@ export async function fetchData(url: string, options?: FetchOptions) { export async function fetchExternalData(url: string) { try { - const response = await fetch(url); + const response = await fetch(url, { + referrerPolicy: 'no-referrer', // Send no referrer header for privacy reasons. + referrer: '', + }); if (!response.ok) { const message = `An error has occured: ${response.status}`; throw new Error(message);