forked from Deuxfleurs/garage
Compatibility fixes
This commit is contained in:
parent
0957d0fdfa
commit
3686f100b7
2 changed files with 5 additions and 9 deletions
|
@ -226,13 +226,7 @@ async fn handler_inner(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_bucket_key(path: &str) -> Result<(&str, Option<&str>), Error> {
|
fn parse_bucket_key(path: &str) -> Result<(&str, Option<&str>), Error> {
|
||||||
if !path.starts_with('/') {
|
let path = path.trim_start_matches('/');
|
||||||
return Err(Error::BadRequest(format!(
|
|
||||||
"Invalid path: {}, should start with a /",
|
|
||||||
path
|
|
||||||
)));
|
|
||||||
}
|
|
||||||
let path = &path[1..];
|
|
||||||
|
|
||||||
match path.find('/') {
|
match path.find('/') {
|
||||||
Some(i) => Ok((&path[..i], Some(&path[i + 1..]))),
|
Some(i) => Ok((&path[..i], Some(&path[i + 1..]))),
|
||||||
|
|
|
@ -103,7 +103,8 @@ pub async fn handle_list(
|
||||||
writeln!(
|
writeln!(
|
||||||
&mut xml,
|
&mut xml,
|
||||||
"\t\t<Key>{}</Key>",
|
"\t\t<Key>{}</Key>",
|
||||||
xml_encode_key(key, urlencode_resp)
|
xml_escape(key),
|
||||||
|
//xml_encode_key(key, urlencode_resp) // doesn't work with nextcloud, wtf
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
writeln!(&mut xml, "\t\t<LastModified>{}</LastModified>", last_modif).unwrap();
|
writeln!(&mut xml, "\t\t<LastModified>{}</LastModified>", last_modif).unwrap();
|
||||||
|
@ -117,7 +118,8 @@ pub async fn handle_list(
|
||||||
writeln!(
|
writeln!(
|
||||||
&mut xml,
|
&mut xml,
|
||||||
"\t<Prefix>{}</Prefix>",
|
"\t<Prefix>{}</Prefix>",
|
||||||
xml_encode_key(pfx, urlencode_resp)
|
xml_escape(pfx),
|
||||||
|
//xml_encode_key(pfx, urlencode_resp)
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue