* [pbs-devel] [PATCH proxmox] s3-client: make truncation flag optional in list object v2 response
@ 2026-01-07 12:07 Christian Ebner
0 siblings, 0 replies; only message in thread
From: Christian Ebner @ 2026-01-07 12:07 UTC (permalink / raw)
To: pbs-devel
Some providers do not return the `IsTruncated` flag [0] in the
response body for list object v2 API calls, signaling that there are
further object keys to be returned by subsequent API calls providing
the next continuation token.
Since this flag is optional, allow it to be missing for XML response
body parsing and default for it to be false in the client response.
Other unused members for the struct used for XML parsing have already
been dropped in commit eb559d87 ("fix #7008: s3-client: drop unused
optional object list v2 response fields").
Fixes: https://forum.proxmox.com/threads/178707/
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
proxmox-s3-client/src/response_reader.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proxmox-s3-client/src/response_reader.rs b/proxmox-s3-client/src/response_reader.rs
index 47fcd129..e03b3bb0 100644
--- a/proxmox-s3-client/src/response_reader.rs
+++ b/proxmox-s3-client/src/response_reader.rs
@@ -37,7 +37,7 @@ pub struct ListObjectsV2Response {
/// https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html#API_ListObjectsV2_ResponseSyntax
struct ListObjectsV2ResponseBody {
/// Flag indication if response was truncated because of key limits.
- pub is_truncated: bool,
+ pub is_truncated: Option<bool>,
/// Token used for this request to get further keys in truncated responses.
pub continuation_token: Option<String>,
/// Allows to fetch the next set of keys for truncated responses.
@@ -50,7 +50,7 @@ impl ListObjectsV2ResponseBody {
fn with_optional_date(self, date: Option<HttpDate>) -> ListObjectsV2Response {
ListObjectsV2Response {
date,
- is_truncated: self.is_truncated,
+ is_truncated: self.is_truncated.unwrap_or_default(),
continuation_token: self.continuation_token,
next_continuation_token: self.next_continuation_token,
contents: self.contents.unwrap_or_default(),
@@ -530,7 +530,7 @@ fn parse_list_objects_v2_response_test() {
</ListBucketResult>
"#;
let result: ListObjectsV2ResponseBody = serde_xml_rs::from_str(response_body).unwrap();
- assert!(!result.is_truncated);
+ assert_eq!(result.is_truncated, Some(false));
assert_eq!(
result.contents.unwrap(),
vec![
--
2.47.3
_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-07 12:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-07 12:07 [pbs-devel] [PATCH proxmox] s3-client: make truncation flag optional in list object v2 response Christian Ebner
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.