Skip to content

Commit

Permalink
feat: explicit cache: no-cache in fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
hf committed Feb 3, 2024
1 parent e659050 commit a26d23f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,10 @@ export async function _request(
fetcher,
method,
url + queryString,
{ headers, noResolveJson: options?.noResolveJson },
{
headers,
noResolveJson: options?.noResolveJson,
},
{},
options?.body
)
Expand All @@ -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)

Expand Down

0 comments on commit a26d23f

Please sign in to comment.