File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -1071,7 +1071,7 @@ export class PassThroughHandler extends Serializable implements RequestHandler {
10711071 reqBodyOverride = await readFile ( replaceBodyFromFile , null ) ;
10721072 } else if ( updateJsonBody ) {
10731073 const { body : realBody } = await waitForCompletedRequest ( clientReq ) ;
1074- if ( realBody . getJson === undefined ) {
1074+ if ( await realBody . getJson ( ) === undefined ) {
10751075 throw new Error ( "Can't transform non-JSON request body" ) ;
10761076 }
10771077
@@ -1285,8 +1285,9 @@ export class PassThroughHandler extends Serializable implements RequestHandler {
12851285 resBodyOverride = await readFile ( replaceBodyFromFile , null ) ;
12861286 } else if ( updateJsonBody ) {
12871287 const rawBody = await streamToBuffer ( serverRes ) ;
1288- const realBody = buildBodyReader ( rawBody , serverHeaders )
1289- if ( realBody . getJson === undefined ) {
1288+ const realBody = buildBodyReader ( rawBody , serverRes . headers ) ;
1289+
1290+ if ( await realBody . getJson ( ) === undefined ) {
12901291 throw new Error ( "Can't transform non-JSON response body" ) ;
12911292 }
12921293
You can’t perform that action at this time.
0 commit comments