Explicity send no referrer headers to external requests for privacy
This commit is contained in:
@@ -118,7 +118,10 @@ export async function fetchData(url: string, options?: FetchOptions) {
|
|||||||
|
|
||||||
export async function fetchExternalData(url: string) {
|
export async function fetchExternalData(url: string) {
|
||||||
try {
|
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) {
|
if (!response.ok) {
|
||||||
const message = `An error has occured: ${response.status}`;
|
const message = `An error has occured: ${response.status}`;
|
||||||
throw new Error(message);
|
throw new Error(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user