@@ -482,11 +482,26 @@ test({
482482 const response = await context . response . toDomResponse ( ) ;
483483 assertEquals ( response . status , 206 ) ;
484484 assertEquals ( context . response . type , ".json" ) ;
485- assertEquals ( context . response . headers . get ( "content-length" ) , "5 " ) ;
485+ assertEquals ( context . response . headers . get ( "content-length" ) , "6 " ) ;
486486 assertEquals ( await response . text ( ) , `{\n "h` ) ;
487487 } ,
488488} ) ;
489489
490+ test ( {
491+ name : "range header from 0-" ,
492+ ignore : Deno . build . os === "windows" ,
493+ async fn ( ) {
494+ const { context } = setup ( "/test.json" ) ;
495+ context . request . headers . set ( "Range" , "bytes=0-" ) ;
496+ await send ( context , context . request . url . pathname , { root : "./fixtures" } ) ;
497+ const response = await context . response . toDomResponse ( ) ;
498+ assertEquals ( response . status , 206 ) ;
499+ assertEquals ( context . response . type , ".json" ) ;
500+ assertEquals ( context . response . headers . get ( "content-length" ) , "23" ) ;
501+ assertEquals ( await response . text ( ) , `{\n "hello": "world"\n}\n` ) ;
502+ } ,
503+ } ) ;
504+
490505test ( {
491506 name : "range header - multiple ranges" ,
492507 ignore : Deno . build . os === "windows" ,
0 commit comments