Add token with short expiration time to send url

This commit is contained in:
Daniel García
2021-06-25 20:33:51 +02:00
parent f44b2611e6
commit 2cd17fe7af
3 changed files with 52 additions and 43 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, sends, alive, static_files]
routes![web_index, app_id, web_files, attachments, alive, static_files]
} else {
routes![attachments, alive, static_files]
}
@@ -60,11 +60,6 @@ fn attachments(uuid: String, file_id: String) -> Option<NamedFile> {
NamedFile::open(Path::new(&CONFIG.attachments_folder()).join(uuid).join(file_id)).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;