fix: /site caching, closes https://github.com/Xyphyn/photon/issues/508 (#509)
This commit is contained in:
1 parent
348df2329a
commit
0b4005743e
1 file changed
+6
-1
@@ -36,12 +36,17 @@ async function customFetch(
|
|||||||
): Promise<Response> {
|
): Promise<Response> {
|
||||||
const f = func ? func : fetch
|
const f = func ? func : fetch
|
||||||
|
|
||||||
if (init)
|
if (init) {
|
||||||
init.headers = {
|
init.headers = {
|
||||||
...init.headers,
|
...init.headers,
|
||||||
...(auth ? { authorization: `Bearer ${auth}` } : {}),
|
...(auth ? { authorization: `Bearer ${auth}` } : {}),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (auth) {
|
||||||
|
init.cache = 'no-store'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (init?.body && auth) {
|
if (init?.body && auth) {
|
||||||
try {
|
try {
|
||||||
const json = JSON.parse(init.body.toString())
|
const json = JSON.parse(init.body.toString())
|
||||||
|
|||||||
Reference in new issue
Block a user