aboutsummaryrefslogtreecommitdiff
path: root/src/api/api_server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-04-28 10:35:04 +0000
committerAlex Auvolat <alex@adnab.me>2020-04-28 10:35:04 +0000
commit3686f100b7e46d60758e4a1cc70586444ddb5f7a (patch)
tree7c1869c4092cdd922a10ec291b94796f9affd1e1 /src/api/api_server.rs
parent0957d0fdfadb27e49c24d63994f52197a9c9cd1c (diff)
downloadgarage-3686f100b7e46d60758e4a1cc70586444ddb5f7a.tar.gz
garage-3686f100b7e46d60758e4a1cc70586444ddb5f7a.zip
Compatibility fixes
Diffstat (limited to 'src/api/api_server.rs')
-rw-r--r--src/api/api_server.rs8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/api/api_server.rs b/src/api/api_server.rs
index 6ba5e532..af331a39 100644
--- a/src/api/api_server.rs
+++ b/src/api/api_server.rs
@@ -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..]))),