diff --git a/src/routes.rs b/src/routes.rs index 07c0af8..5847a25 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -18,6 +18,9 @@ use std::{fs, path::PathBuf}; /// Parses an ID fn parse_id(id: &str) -> Result { + // Remove any file extension from id + let id = id.split('.').next().unwrap(); + match i32::from_str_radix(id, 36) { Ok(id) => Ok(id), Err(_) => Err(HttpResponse::BadRequest().body("Invalid ID")),