mirror of
https://github.com/minio/minio-rs.git
synced 2026-01-22 15:42:10 +08:00
list_objects(): fix parsing user metadata as per MinIO server (#23)
Signed-off-by: Bala.FA <bala@minio.io>
This commit is contained in:
parent
4da529a13f
commit
49452a0b73
@ -114,7 +114,7 @@ fn parse_list_objects_contents(
|
|||||||
is_delete_marker: bool,
|
is_delete_marker: bool,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
loop {
|
loop {
|
||||||
let content = match root.take_child(tag) {
|
let mut content = match root.take_child(tag) {
|
||||||
Some(v) => v,
|
Some(v) => v,
|
||||||
None => break,
|
None => break,
|
||||||
};
|
};
|
||||||
@ -138,12 +138,15 @@ fn parse_list_objects_contents(
|
|||||||
),
|
),
|
||||||
None => (None, None),
|
None => (None, None),
|
||||||
};
|
};
|
||||||
let user_metadata = match content.get_child("UserMetadata") {
|
let user_metadata = match content.get_mut_child("UserMetadata") {
|
||||||
Some(v) => {
|
Some(v) => {
|
||||||
let mut map: HashMap<String, String> = HashMap::new();
|
let mut map: HashMap<String, String> = HashMap::new();
|
||||||
for node in v.children.iter() {
|
loop {
|
||||||
let e = node.as_element().unwrap();
|
let item = match v.take_child("Items") {
|
||||||
map.insert(e.name.clone(), e.get_text().unwrap_or_default().to_string());
|
Some(v) => v,
|
||||||
|
None => break,
|
||||||
|
};
|
||||||
|
map.insert(get_text(&item, "Key")?, get_text(&item, "Value")?);
|
||||||
}
|
}
|
||||||
Some(map)
|
Some(map)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user