File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,8 @@ pub(super) fn ico_handler(req: &mut Request) -> IronResult<Response> {
132
132
133
133
#[ cfg( test) ]
134
134
mod tests {
135
+ use iron:: status:: Status ;
136
+
135
137
use super :: { serve_file, STATIC_SEARCH_PATHS , STYLE_CSS , VENDORED_CSS } ;
136
138
use crate :: test:: wrapper;
137
139
use std:: fs;
@@ -295,7 +297,12 @@ mod tests {
295
297
// Still, the test ensures the underlying function called by the request handler to
296
298
// serve the file also includes protection for path traversal, in the event we switch
297
299
// to a framework that doesn't include builtin protection in the future.
298
- assert ! ( serve_file( path) . is_err( ) , "{} was served" , path) ;
300
+ assert_eq ! (
301
+ Some ( Status :: NotFound ) ,
302
+ serve_file( path) . unwrap_err( ) . response. status,
303
+ "{} did not return a 404" ,
304
+ path
305
+ ) ;
299
306
}
300
307
}
301
308
}
You can’t perform that action at this time.
0 commit comments