File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -414,10 +414,7 @@ export class Recorder {
414414 } ) ;
415415
416416 // Because we JSON.parse responses, we need to stringify it
417- if (
418- headers [ "content-type" ] &&
419- headers [ "content-type" ] . startsWith ( "application/json" )
420- ) {
417+ if ( String ( headers [ "content-type" ] ) . includes ( "application/json" ) ) {
421418 request . write ( JSON . stringify ( body ) ) ;
422419 } else {
423420 request . write ( body ) ;
@@ -461,10 +458,7 @@ export class Recorder {
461458 const body = Buffer . concat ( chunks ) . toString ( "utf8" ) ;
462459
463460 // Simple services oftent send "application/json; charset=utf-8"
464- if (
465- headers [ "content-type" ] &&
466- headers [ "content-type" ] . startsWith ( "application/json" )
467- ) {
461+ if ( String ( headers [ "content-type" ] ) . includes ( "application/json" ) ) {
468462 try {
469463 return resolve ( JSON . parse ( body ) ) ;
470464 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments