create & use logo
This commit is contained in:
+5
-2
@@ -342,8 +342,11 @@ async fn static_asset(Path(path): Path<String>) -> Response {
|
||||
let Some(asset) = assets::STORE.get(&path) else {
|
||||
return StatusCode::NOT_FOUND.into_response();
|
||||
};
|
||||
let mime = match path.as_str() {
|
||||
"style.css" => "text/css",
|
||||
let mime = match path.rsplit('.').next() {
|
||||
Some("css") => "text/css",
|
||||
Some("ico") => "image/x-icon",
|
||||
Some("png") => "image/png",
|
||||
Some("svg") => "image/svg+xml",
|
||||
_ => "application/javascript",
|
||||
};
|
||||
let mut response = ([(header::CONTENT_TYPE, mime)], asset.data).into_response();
|
||||
|
||||
Reference in New Issue
Block a user