changesin headers

This commit is contained in:
Mateusz Gruszczyński
2026-08-02 11:04:04 +02:00
parent ede6d1de92
commit 464660a274
3 changed files with 47 additions and 36 deletions
-17
View File
@@ -524,23 +524,6 @@ pub async fn download_file(
serve_token_file(&state, &token, &filename).await
}
pub async fn download_legacy_file(
State(state): State<SharedState>,
Path((directory, filename)): Path<(String, String)>,
) -> Result<Response, ApiError> {
let Some((id_part, token)) = directory.split_once('_') else {
return Err(ApiError::not_found_file());
};
let id: i64 = id_part.parse().map_err(|_| ApiError::not_found_file())?;
let owner = db::find_file_owner(&state.db, token)
.await?
.ok_or_else(ApiError::not_found_file)?;
if owner.id != id {
return Err(ApiError::not_found_file());
}
serve_token_file(&state, token, &filename).await
}
async fn serve_token_file(
state: &SharedState,
token: &str,