small tweaks

This commit is contained in:
minish 2023-02-02 18:05:30 -05:00 committed by minish
parent 08826148bb
commit 53b0b95554
2 changed files with 8 additions and 8 deletions

View File

@ -273,7 +273,7 @@ impl Engine {
let mut cache = self.cache.write().await;
cache.insert(name, data.clone());
info!(/* */"recached upload from disk!");
info!("recached upload from disk!");
return Ok(ViewSuccess::FromCache(data));
}

View File

@ -13,13 +13,6 @@ pub async fn new(
Query(params): Query<HashMap<String, String>>,
stream: BodyStream,
) -> Result<String, StatusCode> {
let original_name = params.get("name");
// the original file name wasn't given, so i can't work out what the extension should be
if original_name.is_none() {
return Err(StatusCode::BAD_REQUEST);
}
let key = params.get("key");
// check upload key, if i need to
@ -27,6 +20,13 @@ pub async fn new(
return Err(StatusCode::FORBIDDEN);
}
let original_name = params.get("name");
// the original file name wasn't given, so i can't work out what the extension should be
if original_name.is_none() {
return Err(StatusCode::BAD_REQUEST);
}
let original_path = PathBuf::from(original_name.unwrap());
let path = engine.gen_path(&original_path).await;