summaryrefslogtreecommitdiffstats
path: root/src/routes/static.rs
diff options
context:
space:
mode:
authorColin Reeder <colin@vpzom.click>2020-08-08 16:32:21 -0600
committerColin Reeder <colin@vpzom.click>2020-08-08 16:32:21 -0600
commit649d33ca68889669d62817765bf8d6a3441b6949 (patch)
tree2c6ef5db952b3a08112a3e62320ad502324250b3 /src/routes/static.rs
parent643eb3ca33122b094c30d4503b20e8e4d7069345 (diff)
Use SVG icons instead of emoji
Diffstat (limited to 'src/routes/static.rs')
-rw-r--r--src/routes/static.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/routes/static.rs b/src/routes/static.rs
index 60a0084..d319efe 100644
--- a/src/routes/static.rs
+++ b/src/routes/static.rs
@@ -1,3 +1,4 @@
+use hitide_icons::ICONS_MAP;
use std::sync::Arc;
const FILE_MAIN_CSS: &[u8] = include_bytes!("../../res/main.css");
@@ -20,6 +21,14 @@ async fn handler_static_get(
);
Ok(resp)
+ } else if let Some(icon) = ICONS_MAP.get(params.0.as_str()) {
+ let mut resp = hyper::Response::new(icon.content.into());
+ resp.headers_mut().insert(
+ hyper::header::CONTENT_TYPE,
+ hyper::header::HeaderValue::from_static("image/svg+xml"),
+ );
+
+ Ok(resp)
} else {
Err(crate::Error::RoutingError(trout::RoutingFailure::NotFound))
}