Skip to content

Commit

Permalink
fix: CORS issue while fetch assets
Browse files Browse the repository at this point in the history
Fix CORS issue when fetching asset, because of incorrect credentials
property value, changed from include to same-origin.
#151
  • Loading branch information
igobranco committed Feb 15, 2024
1 parent 30e645e commit 5c33534
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function urlPath(path: string): string {

export async function getJSON<T>(url: string,requestOptions?: RequestInit): Promise<T> {
if(!requestOptions){
requestOptions = {credentials: 'include'}
requestOptions = {credentials: 'same-origin'}
}
const res = await fetch(url,requestOptions);
return res.json();
Expand Down

0 comments on commit 5c33534

Please sign in to comment.