Skip to content

Commit

Permalink
fix: authorization in get_attachment
Browse files Browse the repository at this point in the history
  • Loading branch information
ElaBosak233 committed Nov 11, 2024
1 parent 443ac93 commit da7ba7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/web/router/challenge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ pub async fn delete(
})
}

pub async fn get_attachment(Path(id): Path<i64>) -> Result<impl IntoResponse, WebError> {
pub async fn get_attachment(Extension(ext): Extension<Ext>, Path(id): Path<i64>) -> Result<impl IntoResponse, WebError> {
let _ = ext.operator.ok_or(WebError::Unauthorized(String::new()))?;
let path = format!("challenges/{}/attachment", id);
match crate::media::scan_dir(path.clone()).await.unwrap().first() {
Some((filename, _size)) => {
Expand Down

0 comments on commit da7ba7a

Please sign in to comment.