1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-05-22 11:33:57 +00:00
This commit is contained in:
Daniel García 2021-03-14 23:35:55 +01:00
parent 2969e87b52
commit 8da5b99482
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
20 changed files with 812 additions and 2 deletions

View file

@ -10,7 +10,7 @@ pub fn routes() -> Vec<Route> {
// If addding more routes here, consider also adding them to
// crate::utils::LOGGED_ROUTES to make sure they appear in the log
if CONFIG.web_vault_enabled() {
routes![web_index, app_id, web_files, attachments, alive, static_files]
routes![web_index, app_id, web_files, attachments, sends, alive, static_files]
} else {
routes![attachments, alive, static_files]
}
@ -60,6 +60,11 @@ fn attachments(uuid: String, file: PathBuf) -> Option<NamedFile> {
NamedFile::open(Path::new(&CONFIG.attachments_folder()).join(uuid).join(file)).ok()
}
#[get("/sends/<send_id>/<file_id>")]
fn sends(send_id: String, file_id: String) -> Option<NamedFile> {
NamedFile::open(Path::new(&CONFIG.sends_folder()).join(send_id).join(file_id)).ok()
}
#[get("/alive")]
fn alive() -> Json<String> {
use crate::util::format_date;