vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

icons.rs (449B)


      1 use crate::util::Cached;
      2 use rocket::{http::ContentType, Route};
      3 pub fn routes() -> Vec<Route> {
      4     routes![icon_internal]
      5 }
      6 #[allow(unused_variables)]
      7 #[get("/<domain>/icon.png")]
      8 fn icon_internal(domain: &str) -> Cached<(ContentType, Vec<u8>)> {
      9     Cached::ttl(
     10         (
     11             ContentType::new("image", "png"),
     12             include_bytes!("../static/images/fallback-icon.png").to_vec(),
     13         ),
     14         2_592_000,
     15         true,
     16     )
     17 }