Compatibility fixes

This commit is contained in:
Alex Auvolat
2020-04-28 10:35:04 +00:00
parent 0957d0fdfa
commit 3686f100b7
2 changed files with 5 additions and 9 deletions
+1 -7
View File
@@ -226,13 +226,7 @@ async fn handler_inner(
}
fn parse_bucket_key(path: &str) -> Result<(&str, Option<&str>), Error> {
if !path.starts_with('/') {
return Err(Error::BadRequest(format!(
"Invalid path: {}, should start with a /",
path
)));
}
let path = &path[1..];
let path = path.trim_start_matches('/');
match path.find('/') {
Some(i) => Ok((&path[..i], Some(&path[i + 1..]))),