File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,8 @@ export const setVaryHeaders = (
75
75
headers . set ( `netlify-vary` , generateNetlifyVaryValues ( netlifyVaryValues ) )
76
76
}
77
77
78
+ const fetchBeforeNextPatchedIt = globalThis . fetch
79
+
78
80
/**
79
81
* Change the date header to be the last-modified date of the blob. This means the CDN
80
82
* will use the correct expiry time for the response. e.g. if the blob was last modified
@@ -101,7 +103,7 @@ export const adjustDateHeader = async (
101
103
}
102
104
const key = new URL ( request . url ) . pathname
103
105
const blobKey = await encodeBlobKey ( key )
104
- const blobStore = getDeployStore ( )
106
+ const blobStore = getDeployStore ( { fetch : fetchBeforeNextPatchedIt } )
105
107
106
108
// TODO: use metadata for this
107
109
const { lastModified } = await tracer . startActiveSpan (
Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ import type { getRequestHandlers } from 'next/dist/server/lib/start-server.js'
9
9
10
10
type FS = typeof import ( 'fs' )
11
11
12
+ const fetchBeforeNextPatchedIt = globalThis . fetch
13
+
12
14
export async function getMockedRequestHandlers ( ...args : Parameters < typeof getRequestHandlers > ) {
13
15
const tracer = trace . getTracer ( 'Next.js Runtime' )
14
16
return tracer . startActiveSpan ( 'mocked request handler' , async ( span ) => {
15
- const store = getDeployStore ( )
17
+ const store = getDeployStore ( { fetch : fetchBeforeNextPatchedIt } )
16
18
const ofs = { ...fs }
17
19
18
20
const { encodeBlobKey } = await import ( '../shared/blobkey.js' )
You can’t perform that action at this time.
0 commit comments