File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,15 +55,13 @@ function getBodyCacheKeyJson(body: unknown): string | object | undefined {
5555}
5656
5757async function getRequestCacheKeyJson ( request : Request ) {
58- const body = await request . arrayBuffer ( ) ;
59-
6058 return {
6159 headers : getHeadersCacheKeyJson ( Array . from ( request . headers . entries ( ) ) ) ,
6260 method : request . method ,
6361 redirect : request . redirect ,
6462 referrer : request . referrer ,
6563 url : request . url ,
66- body : getBodyCacheKeyJson ( body ) ,
64+ body : 'request_body' as undefined | string | object ,
6765 // Confirmed that this property exists, but it's not in the types
6866 follow : ( request as any ) . follow , // eslint-disable-line @typescript-eslint/no-unsafe-assignment
6967 // Confirmed that this property exists, but it's not in the types
Original file line number Diff line number Diff line change @@ -38,18 +38,12 @@ async function getResponse(
3838 resource : FetchResource ,
3939 init : FetchInit ,
4040) {
41- const originalResource = resource ;
42-
4341 if ( typeof resource !== 'string' && ! ( resource instanceof Request ) ) {
4442 throw new TypeError (
4543 'The first argument to fetch must be either a string or a fetch Request instance' ,
4644 ) ;
4745 }
4846
49- if ( originalResource instanceof Request ) {
50- resource = originalResource . clone ( )
51- }
52-
5347 const cacheKey = await fetchCustomization . calculateCacheKey ( resource , init ) ;
5448 const ejectSelfFromCache = async ( ) => fetchCustomization . cache . remove ( cacheKey ) ;
5549
@@ -79,10 +73,6 @@ async function getResponse(
7973 true ,
8074 ) ;
8175 }
82-
83- if ( originalResource instanceof Request ) {
84- resource = originalResource . clone ( )
85- }
8676
8777 const fetchResponse = await fetch ( resource , init ) ;
8878 const serializedMeta = NFCResponse . serializeMetaFromNodeFetchResponse ( fetchResponse ) ;
You can’t perform that action at this time.
0 commit comments