Skip to content

Commit

Permalink
fixup! S3: Add paging to list_object_versions()
Browse files Browse the repository at this point in the history
Clean up response so that:

- VersionIdMarker is included, even if it's an empty string.

- NextVersionIdMarker is only included if it's non-empty.
  • Loading branch information
sveniu committed Oct 17, 2023
1 parent dc253b3 commit 0f6602d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions moto/s3/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,7 @@ def _bucket_response_get(
max_keys=max_keys,
delimiter=delimiter,
key_marker=key_marker,
version_id_marker=version_id_marker,
is_truncated=is_truncated,
next_key_marker=next_key_marker,
next_version_id_marker=next_version_id_marker,
Expand Down Expand Up @@ -2595,11 +2596,14 @@ def _invalid_headers(self, url: str, headers: Dict[str, str]) -> bool:
{% endif %}
<Delimiter>{{ delimiter }}</Delimiter>
<KeyMarker>{{ key_marker or "" }}</KeyMarker>
<VersionIdMarker>{{ version_id_marker or "" }}</VersionIdMarker>
<MaxKeys>{{ max_keys }}</MaxKeys>
{% if is_truncated %}
<IsTruncated>true</IsTruncated>
<NextKeyMarker>{{ next_key_marker }}</NextKeyMarker>
{% if next_version_id_marker %}
<NextVersionIdMarker>{{ next_version_id_marker }}</NextVersionIdMarker>
{% endif %}
{% else %}
<IsTruncated>false</IsTruncated>
{% endif %}
Expand Down

0 comments on commit 0f6602d

Please sign in to comment.