From 5c335342b1a6a6ea49c6fa4295c88fa6acd76a5a Mon Sep 17 00:00:00 2001 From: Ivo Branco Date: Thu, 15 Feb 2024 16:55:01 +0000 Subject: [PATCH] fix: CORS issue while fetch assets Fix CORS issue when fetching asset, because of incorrect credentials property value, changed from include to same-origin. tunapanda/h5p-standalone#151 --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index 874b45c..33caec7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -30,7 +30,7 @@ export function urlPath(path: string): string { export async function getJSON(url: string,requestOptions?: RequestInit): Promise { if(!requestOptions){ - requestOptions = {credentials: 'include'} + requestOptions = {credentials: 'same-origin'} } const res = await fetch(url,requestOptions); return res.json();