File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -385,6 +385,21 @@ export async function testApiHandler<NextResponseJsonType = any>({
385385 void createServerAdapter ( async ( request ) => {
386386 try {
387387 assert ( appHandler !== undefined ) ;
388+
389+ const {
390+ cache,
391+ credentials,
392+ headers,
393+ integrity,
394+ keepalive,
395+ method,
396+ mode,
397+ redirect,
398+ referrer,
399+ referrerPolicy,
400+ signal
401+ } = request ;
402+
388403 const rawRequest = rebindJsonMethodAsSummoner (
389404 new NextRequest (
390405 normalizeUrlForceTrailingSlashIfPathnameEmpty (
@@ -395,15 +410,25 @@ export async function testApiHandler<NextResponseJsonType = any>({
395410 * See also: https://stackoverflow.com/a/57014050/1367414
396411 */
397412 {
398- ...request ,
399413 body : readableStreamOrNullFromAsyncIterable (
400414 // ? request.body claims to be ReadableStream, but it's
401415 // ? actually a Node.js native stream (i.e. iterable)...
402416 request . body as unknown as AsyncIterable < any >
403417 ) ,
418+ cache,
419+ credentials,
404420 // https://github.com/nodejs/node/issues/46221
405- // @ts -expect-error: TS types are not yet updated
406- duplex : 'half'
421+ // @ts -expect-error: Next.js's RequestInit is lacking "duplex"
422+ duplex : 'half' ,
423+ headers,
424+ integrity,
425+ keepalive,
426+ method,
427+ mode,
428+ redirect,
429+ referrer,
430+ referrerPolicy,
431+ signal
407432 }
408433 )
409434 ) ;
You can’t perform that action at this time.
0 commit comments