File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,6 +52,17 @@ async fn favicon() -> Result<Response<Body>, String> {
5252 )
5353}
5454
55+ async fn favicon_png ( ) -> Result < Response < Body > , String > {
56+ Ok (
57+ Response :: builder ( )
58+ . status ( 200 )
59+ . header ( "content-type" , "image/png" )
60+ . header ( "Cache-Control" , "public, max-age=1209600, s-maxage=86400" )
61+ . body ( full ( include_bytes ! ( "../static/favicon.png" ) . as_ref ( ) ) )
62+ . unwrap_or_default ( ) ,
63+ )
64+ }
65+
5566async fn font ( ) -> Result < Response < Body > , String > {
5667 Ok (
5768 Response :: builder ( )
@@ -241,6 +252,7 @@ async fn main() {
241252 . boxed ( )
242253 } ) ;
243254 app. at ( "/favicon.ico" ) . get ( |_| favicon ( ) . boxed ( ) ) ;
255+ app. at ( "/favicon.png" ) . get ( |_| favicon_png ( ) . boxed ( ) ) ;
244256 app. at ( "/logo.png" ) . get ( |_| pwa_logo ( ) . boxed ( ) ) ;
245257 app. at ( "/Inter.var.woff2" ) . get ( |_| font ( ) . boxed ( ) ) ;
246258 app. at ( "/touch-icon-iphone.png" ) . get ( |_| iphone_logo ( ) . boxed ( ) ) ;
You can’t perform that action at this time.
0 commit comments