Browse Source

Explicity send no referrer headers to external requests for privacy

pull/1886/head
Gabe Kangas 4 years ago
parent
commit
8751dd5e91
  1. 5
      web/utils/apis.ts

5
web/utils/apis.ts

@ -118,7 +118,10 @@ export async function fetchData(url: string, options?: FetchOptions) { @@ -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);

Loading…
Cancel
Save