File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,8 @@ impl Handler for Static {
48
48
}
49
49
let mtime = FileTime :: from_last_modification_time ( & data) ;
50
50
let ts = time:: Timespec {
51
- sec : ( mtime. seconds_relative_to_1970 ( ) as i64 ) / 1000 ,
52
- nsec : ( ( ( mtime. nanoseconds ( ) as u32 ) % 1000 ) as i32 ) * 1000000
51
+ sec : mtime. seconds_relative_to_1970 ( ) as i64 ,
52
+ nsec : mtime. nanoseconds ( ) as i32 ,
53
53
} ;
54
54
let tm = time:: at ( ts) . to_utc ( ) ;
55
55
@@ -70,9 +70,12 @@ impl Handler for Static {
70
70
}
71
71
72
72
fn not_found ( ) -> Response {
73
+ let mut headers = HashMap :: new ( ) ;
74
+ headers. insert ( "Content-Length" . to_string ( ) , vec ! [ "0" . to_string( ) ] ) ;
75
+ headers. insert ( "Content-Type" . to_string ( ) , vec ! [ "text/plain" . to_string( ) ] ) ;
73
76
Response {
74
77
status : ( 404 , "Not Found" ) ,
75
- headers : HashMap :: new ( ) ,
78
+ headers : headers ,
76
79
body : Box :: new ( io:: empty ( ) ) ,
77
80
}
78
81
}
You can’t perform that action at this time.
0 commit comments