File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -828,5 +828,20 @@ mod tests {
828
828
. unwrap ( ) ;
829
829
assert_eq ! ( response. headers( ) , expected_response. headers( ) ) ;
830
830
assert_eq ! ( hyper:: body:: to_bytes( response. into_body( ) ) . await . unwrap( ) , hyper:: body:: to_bytes( expected_response. into_body( ) ) . await . unwrap( ) ) ;
831
+
832
+ // Test case 2: Path is "/compare.html"
833
+ let req = Request :: default ( ) ;
834
+ let path = "/compare.html" ;
835
+ let use_compression = false ;
836
+ let response = handle_fs_path ( & req, path, use_compression) . await . unwrap ( ) ;
837
+ let expected_body = TEMPLATES . get_template ( "compare.html" ) . await . unwrap ( ) ;
838
+ let expected_response = http:: Response :: builder ( )
839
+ . header_typed ( ETag :: from_str ( & format ! ( r#""{}""# , * VERSION_UUID ) ) . unwrap ( ) )
840
+ . header ( CACHE_CONTROL , "max-age=60, stale-while-revalidate=86400" )
841
+ . header_typed ( ContentType :: html ( ) )
842
+ . body ( hyper:: Body :: from ( expected_body) )
843
+ . unwrap ( ) ;
844
+ assert_eq ! ( response. headers( ) , expected_response. headers( ) ) ;
845
+ assert_eq ! ( hyper:: body:: to_bytes( response. into_body( ) ) . await . unwrap( ) , hyper:: body:: to_bytes( expected_response. into_body( ) ) . await . unwrap( ) ) ;
831
846
}
832
847
}
You can’t perform that action at this time.
0 commit comments