From 4a7d2a1e282002b92d6319341853d9160ae1c708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa?= Date: Sat, 31 Aug 2019 17:25:31 +0200 Subject: [PATCH] Rename static files endpoint --- src/api/core/mod.rs | 2 +- src/api/web.rs | 8 ++++---- src/static/templates/email/invite_accepted.html.hbs | 4 ++-- src/static/templates/email/invite_confirmed.html.hbs | 4 ++-- src/static/templates/email/new_device_logged_in.html.hbs | 4 ++-- src/static/templates/email/pw_hint_none.html.hbs | 4 ++-- src/static/templates/email/pw_hint_some.html.hbs | 4 ++-- src/static/templates/email/send_org_invite.html.hbs | 4 ++-- src/static/templates/email/twofactor_email.html.hbs | 4 ++-- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/api/core/mod.rs b/src/api/core/mod.rs index dd5fe284..c37c6f21 100644 --- a/src/api/core/mod.rs +++ b/src/api/core/mod.rs @@ -158,7 +158,7 @@ fn hibp_breach(username: String) -> JsonResult { Ok(Json(json!([{ "title": "--- Error! ---", "description": "HaveIBeenPwned API key not set! Go to https://haveibeenpwned.com/API/Key", - "logopath": "/bwrs_images/error-x.svg" + "logopath": "/bwrs_static/error-x.svg" }]))) } } diff --git a/src/api/web.rs b/src/api/web.rs index 106dca79..ea08a7d4 100644 --- a/src/api/web.rs +++ b/src/api/web.rs @@ -14,9 +14,9 @@ use crate::CONFIG; pub fn routes() -> Vec { if CONFIG.web_vault_enabled() { - routes![web_index, app_id, web_files, attachments, alive, images] + routes![web_index, app_id, web_files, attachments, alive, static_files] } else { - routes![attachments, alive] + routes![attachments, alive, static_files] } } @@ -64,8 +64,8 @@ fn alive() -> Json { Json(format_date(&Utc::now().naive_utc())) } -#[get("/bwrs_images/")] -fn images(filename: String) -> Result, Error> { +#[get("/bwrs_static/")] +fn static_files(filename: String) -> Result, Error> { match filename.as_ref() { "mail-github.png" => Ok(Content(ContentType::PNG, include_bytes!("../static/images/mail-github.png"))), "logo-gray.png" => Ok(Content(ContentType::PNG, include_bytes!("../static/images/logo-gray.png"))), diff --git a/src/static/templates/email/invite_accepted.html.hbs b/src/static/templates/email/invite_accepted.html.hbs index 6c36f372..0f03700d 100644 --- a/src/static/templates/email/invite_accepted.html.hbs +++ b/src/static/templates/email/invite_accepted.html.hbs @@ -82,7 +82,7 @@ Invitation accepted @@ -118,7 +118,7 @@ Invitation accepted diff --git a/src/static/templates/email/invite_confirmed.html.hbs b/src/static/templates/email/invite_confirmed.html.hbs index c5c01547..20644e6d 100644 --- a/src/static/templates/email/invite_confirmed.html.hbs +++ b/src/static/templates/email/invite_confirmed.html.hbs @@ -82,7 +82,7 @@ Invitation to {{org_name}} confirmed
@@ -114,7 +114,7 @@ Invitation to {{org_name}} confirmed diff --git a/src/static/templates/email/new_device_logged_in.html.hbs b/src/static/templates/email/new_device_logged_in.html.hbs index 0bf1e7b8..94a1714f 100644 --- a/src/static/templates/email/new_device_logged_in.html.hbs +++ b/src/static/templates/email/new_device_logged_in.html.hbs @@ -82,7 +82,7 @@ New Device Logged In From {{device}}
@@ -128,7 +128,7 @@ New Device Logged In From {{device}} diff --git a/src/static/templates/email/pw_hint_none.html.hbs b/src/static/templates/email/pw_hint_none.html.hbs index 1cbc8cbe..12729bf9 100644 --- a/src/static/templates/email/pw_hint_none.html.hbs +++ b/src/static/templates/email/pw_hint_none.html.hbs @@ -82,7 +82,7 @@ Sorry, you have no password hint...
@@ -113,7 +113,7 @@ Sorry, you have no password hint... diff --git a/src/static/templates/email/pw_hint_some.html.hbs b/src/static/templates/email/pw_hint_some.html.hbs index 34a95818..0b17bdd9 100644 --- a/src/static/templates/email/pw_hint_some.html.hbs +++ b/src/static/templates/email/pw_hint_some.html.hbs @@ -82,7 +82,7 @@ Your master password hint
@@ -119,7 +119,7 @@ Your master password hint diff --git a/src/static/templates/email/send_org_invite.html.hbs b/src/static/templates/email/send_org_invite.html.hbs index ea3e7eea..3c3fc25f 100644 --- a/src/static/templates/email/send_org_invite.html.hbs +++ b/src/static/templates/email/send_org_invite.html.hbs @@ -82,7 +82,7 @@ Join {{org_name}}
@@ -121,7 +121,7 @@ Join {{org_name}} diff --git a/src/static/templates/email/twofactor_email.html.hbs b/src/static/templates/email/twofactor_email.html.hbs index 32898047..193cd9ef 100644 --- a/src/static/templates/email/twofactor_email.html.hbs +++ b/src/static/templates/email/twofactor_email.html.hbs @@ -82,7 +82,7 @@ Your Two-step Login Verification Code
@@ -113,7 +113,7 @@ Your Two-step Login Verification Code