mirror of https://github.com/raftario/filite.git
Don't include file extension when searching for id
This commit is contained in:
parent
d3485a01d2
commit
8d77740588
|
@ -18,6 +18,9 @@ use std::{fs, path::PathBuf};
|
|||
|
||||
/// Parses an ID
|
||||
fn parse_id(id: &str) -> Result<i32, HttpResponse> {
|
||||
// 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")),
|
||||
|
|
Loading…
Reference in New Issue