From a79334ea4c1b18e534bc5d66e1a2746c83a567c7 Mon Sep 17 00:00:00 2001 From: TheMardy Date: Sat, 16 Feb 2019 03:44:30 +0100 Subject: [PATCH] Added static email image routes --- src/api/web.rs | 13 ++++++++++++- src/static/images/logo-gray.png | Bin 0 -> 5431 bytes src/static/images/mail-github.png | Bin 0 -> 1349 bytes 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/static/images/logo-gray.png create mode 100644 src/static/images/mail-github.png diff --git a/src/api/web.rs b/src/api/web.rs index 9b08a723..5c341cc6 100644 --- a/src/api/web.rs +++ b/src/api/web.rs @@ -9,11 +9,12 @@ use rocket_contrib::json::Json; use serde_json::Value; use crate::util::Cached; +use crate::error::Error; use crate::CONFIG; pub fn routes() -> Vec { if CONFIG.web_vault_enabled() { - routes![web_index, app_id, web_files, attachments, alive] + routes![web_index, app_id, web_files, attachments, alive, images] } else { routes![attachments, alive] } @@ -62,3 +63,13 @@ fn alive() -> Json { Json(format_date(&Utc::now().naive_utc())) } + +#[get("/images/")] +fn images(filename: String) -> Result>, Error> { + let image_type = ContentType::new("image", "x-icon"); + match filename.as_ref() { + "mail-github.png" => Ok(Content(image_type , include_bytes!("../static/images/mail-github.png").to_vec())), + "logo-gray.png" => Ok(Content(image_type, include_bytes!("../static/images/logo-gray.png").to_vec())), + _ => err!("Image not found") + } +} \ No newline at end of file diff --git a/src/static/images/logo-gray.png b/src/static/images/logo-gray.png new file mode 100644 index 0000000000000000000000000000000000000000..05c3e5344a5d4df5d06aeb71a364eb11d73b3485 GIT binary patch literal 5431 zcmW+)byO2x8y+B1f|P`W(y@Vrq8lL{0;5Yn7>$6`h>?P%gpvX>_|aVhM>o4bXwfOFi zy_}{T08rKcocQA&e$EV6GKTB9+QEHb9<~5E8&@ma$7(Jxds|&wm<_^xz*Y(XpdV0E zl+*WJI7BYGFE%km%wB9sYY@W(tEG~BrXHwPc6boi2!1vTIV4v!vMeE-!lp;-hNP2A z_z=tV&UZ+316tPQKVP;p$M;4n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Z+PuQn^om)^P|+OR zmF<)3Nw(cF9{Hm>WwXyba;2{W4J!L=?#QTT3;meVY1@0Kh?L;Jch8M#P`XoZoPr~I7%Sot%C`dNY+HlM} zQed?*7d%WJC&$#YB;fq)xbxuz1wE0ybaTL#qpyTnP}1ZBa1hQUuDc%mNwAEDbyuj( zNjJaAn1*Wy9X?!X;h*&L6HA(zyNxJ@_k)K@ueN68{P93VqK) zLClB<=Nzo5+j{Pu=pW;v=9x8ji)BB7|Aqf+$QhJ#y#USj!W!0+r6eS+VlH-<}oxE1&S^v6!4pW($cy&d5U!B z<20P$N%Z?!U^V+$OGC>E@-jx3{mlKws*1BFQS_ZJI)*BSy3r)=vH#ZI59Z#O#t}4+ zI~|<9Xqcp%*-!aI8@3uNKGR@vcc~#c^0lEoP;|kOiW-e;)j z9LZii?iocF9!HZ7YnD(7z1^2-NwQiFYp9pS0You*{SwA|GKs^j&`)RiY@{C!(&0ge(V%sWNp1HMa{XX z%fV!}+x^jpcOh1H_+Ct!l;ukYXUwY~pUv*EDwzoQ>2bJQO!WtF)T+GMT3X>CQx~;y z(tAvAmX-k*DGl~Py51)uuT0)Gx6AQ#H{|k&>SAvyMKd$Dj8t<#BwCO|QiGAP?MW3+ z%OHO&LmA! z6ixp9uv0ZVJ9~R``TM-AVwZc%&T6_ahmSbpbT4xS_bgpaFyTcGE`3YEI)|(4sOXH{ z8~Roep@TZm(#?Kh%n~U55%Fq!@FPVG=?@!w&hjY14mrHBgm;W?-8U|;KnqqLQ406k=a%~Lh7th4 zwQcj>UQEuzQ8v@L|2pjTKTHqnQ(7s65-C#Wuf)PX5D@&cvld4a8forq!j?LScas4BJ#QC!^8a*cw0H;a e-=f07+dE7E32lKSU+53Ue~6kARIyUtGW37hY)h5^ literal 0 HcmV?d00001 diff --git a/src/static/images/mail-github.png b/src/static/images/mail-github.png new file mode 100644 index 0000000000000000000000000000000000000000..07935f116fe9b54db3721eb56119ff65bd9c92ad GIT binary patch literal 1349 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bYNg$oE_j3;tJ%>90h|i1XBMlo(_zj zj*=k1UQ5m7O5Nhujwc?Csf6;(BLEp1&reFH-y6H_w_D{C8D zJ9`I57k4jjUqAnVz>v_$*tqz_q~w&e%py84FZwvNv3p1%HxQ>IRzF?;U3 zMT?iNTD^AthAmrn?mKYw_?dI(FJ8WS{pPJZ_Z~fY_VVrfk6*w4{QdXjkgpk$4FT+%iZoA8a58D) zC@#Nmzx!_4_uG4uZ|}A9pU;0Q_~pZwOHciJ_pT~6v&v#^!WpZ`FDpNGS8}TbZI-+J zAuZTrQdELFw`NJQ=#9{WPVVh-Mh8#pSnY6R4$g4DyL4h@tL>Zkj1@VHTdRDMQ(5ow z*Dx1fxbsMQrjt+KLjHSybDCw>)XlO!9Uyk-R?1!&zG>tsALMbp%2d$h%Rez;qHiUGx5#ZiA&c80t`0v%DpjmJ zA8PLq$u`*FHt`t8QB{c@E`~kpHTe!W$R7=lSk@rerTXX839+6Wz^~r=8NnKI-R4%xZ}i(-(0aPl#=xr z3M9Tq%UgM^H#+v-@vJSIT;2YY4e>YHw|zVRqvy9^qvN#-zB${=Bf|d~tX&ZJ?nUyp z6ARXznU&7|;DNte-TT%X`_Ju_TexsO<9pc@Hi?-IXIQ>haW8x?QE|09I{aq9R)OTu zo3G52zKJor-uN-C^z?-(HF zJib!PcUFn{z2bys*1Hm>-4|A>ulcCAV6EXX+rW&(^#&i3vQ)0y7p#$=)i1d@DVcxu zk!Ai1B-4XWI$6gD^*9?l8us$tyPufBG|RKCtZ%V$`ZV6j7h)0*&uPvx>X+ETbT*Xj z6tl;qnV(M>U+9_euZB(S&E?81C-}cUsQ)H^&_GF|TwuO6FvBr;y85}Sb4q9e0ER}A APyhe` literal 0 HcmV?d00001