Fix utf-8 decoding
This commit is contained in:
parent
390b02fa2c
commit
a5ec0249f8
@ -12,7 +12,8 @@ export default async function cachedFetch(url, duration) {
|
|||||||
return cached;
|
return cached;
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await fetch(url).then((res) => res.json());
|
// wrapping text in JSON.parse to handle utf-8 issues
|
||||||
|
const data = JSON.parse(await fetch(url).then((res) => res.text()));
|
||||||
cache.put(url, data, duration * 1000 * 60);
|
cache.put(url, data, duration * 1000 * 60);
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user