memorable download codes

This commit is contained in:
xenofem 2022-05-01 03:28:25 -04:00
parent 511bd741dd
commit 86bdac20af
7 changed files with 31 additions and 10 deletions

View file

@ -1,7 +1,6 @@
mod download;
mod store;
mod upload;
mod util;
mod zip;
use std::{fs::File, path::PathBuf};
@ -25,7 +24,7 @@ async fn handle_download(
data: AppData,
) -> actix_web::Result<HttpResponse> {
let file_code = path.into_inner();
if !util::is_ascii_alphanumeric(&file_code) {
if !store::is_valid_storage_code(&file_code) {
return Ok(HttpResponse::NotFound().finish());
}
let data = data.read().await;