From a26d23f52fc8bac212c9c88328f67b379489bce2 Mon Sep 17 00:00:00 2001 From: Stojan Dimitrovski Date: Sun, 4 Feb 2024 00:54:15 +0100 Subject: [PATCH] feat: explicit `cache: no-cache` in fetch --- src/lib/fetch.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index 3bc4ef57b..68f89e998 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -118,7 +118,10 @@ export async function _request( fetcher, method, url + queryString, - { headers, noResolveJson: options?.noResolveJson }, + { + headers, + noResolveJson: options?.noResolveJson, + }, {}, options?.body ) @@ -138,7 +141,10 @@ async function _handleRequest( let result: any try { - result = await fetcher(url, requestParams) + result = await fetcher(url, { + ...requestParams, + cache: 'no-cache', // UNDER NO CIRCUMSTANCE SHOULD THIS OPTION BE REMOVED, YOU MAY BE OPENING UP A SECURITY HOLE IN NEXT.JS APPS + }) } catch (e) { console.error(e)