File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,9 @@ trait IsFavicon {
126126
127127impl IsFavicon for PathBuf {
128128 fn is_favicon ( & self ) -> bool {
129- match self . clone ( ) . into_os_string ( ) . into_string ( ) {
130- Ok ( s) => s == FAVICON_ICO_FILENAME || s == FAVICON_PNG_FILENAME ,
131- Err ( _ ) => false ,
129+ match self . clone ( ) . file_name ( ) {
130+ Some ( s) => s == FAVICON_ICO_FILENAME || s == FAVICON_PNG_FILENAME ,
131+ None => false ,
132132 }
133133 }
134134}
@@ -469,7 +469,10 @@ mod tests {
469469 let req = spin_http:: Request {
470470 method : spin_http:: Method :: Get ,
471471 uri : "http://thisistest.com/" . to_string ( ) ,
472- headers : vec ! [ ( PATH_INFO_HEADER . to_string( ) , "favicon.png" . to_string( ) ) ] ,
472+ headers : vec ! [ (
473+ PATH_INFO_HEADER . to_string( ) ,
474+ FAVICON_PNG_FILENAME . to_string( ) ,
475+ ) ] ,
473476 params : vec ! [ ] ,
474477 body : None ,
475478 } ;
You can’t perform that action at this time.
0 commit comments