@@ -565,44 +565,6 @@ describe('Content-Type filtering', () => {
565565 } ) . expect ( 200 , { hello : 'world' } )
566566 } )
567567
568- it ( 'matches with a specified MIME type' , async ( ) => {
569- const server = createServer ( async ( req : ReqWithBody , res ) => {
570- await json ( { type : 'application/json' } ) ( req , res , ( err ) => err && console . log ( err ) )
571-
572- res . setHeader ( 'Content-Type' , 'application/json' )
573-
574- res . end ( JSON . stringify ( req . body ) )
575- } )
576-
577- await makeFetch ( server ) ( '/' , {
578- body : JSON . stringify ( { hello : 'world' } ) ,
579- method : 'POST' ,
580- headers : {
581- Accept : 'application/json' ,
582- 'Content-Type' : 'application/json'
583- }
584- } ) . expect ( 200 , { hello : 'world' } )
585- } )
586-
587- it ( 'matches with a MIME + encoding type' , async ( ) => {
588- const server = createServer ( async ( req : ReqWithBody , res ) => {
589- await json ( { type : 'application/json' } ) ( req , res , ( err ) => err && console . log ( err ) )
590-
591- res . setHeader ( 'Content-Type' , 'application/json; charset=utf-8' )
592-
593- res . end ( JSON . stringify ( req . body ) )
594- } )
595-
596- await makeFetch ( server ) ( '/' , {
597- body : JSON . stringify ( { hello : 'world' } ) ,
598- method : 'POST' ,
599- headers : {
600- Accept : 'application/json' ,
601- 'Content-Type' : 'application/json; charset=utf-8'
602- }
603- } ) . expect ( 200 , { hello : 'world' } )
604- } )
605-
606568 it ( 'executes the type(req) fn if type is a function' , async ( ) => {
607569 const server = createServer ( async ( req : ReqWithBody , res ) => {
608570 await json ( { type : ( req ) => req . headers [ 'content-type' ] === 'application/json' } ) (
0 commit comments