|
|
@@ -62,6 +62,9 @@ while True: |
|
|
|
if not body.startswith(b'<?xml version="1.0" encoding="UTF-8"?>\n<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">'): |
|
|
|
raise RuntimeError(f'Invalid body: {body[:200]}...') |
|
|
|
|
|
|
|
if b'<Marker></Marker>' in body[:200] and 'marker' in params: |
|
|
|
raise RuntimeError('Marker loop (empty marker in response despite providing one)') |
|
|
|
|
|
|
|
# No risk, no fun! |
|
|
|
contents = body.split(b'<Contents>') |
|
|
|
assert all(content.startswith(b'<Key>') for content in contents[1:]) |
|
|
@@ -91,4 +94,6 @@ while True: |
|
|
|
|
|
|
|
if not truncated: |
|
|
|
break |
|
|
|
if 'marker' in params and params['marker'] == lastKey: |
|
|
|
raise RuntimeError('Marker loop (same last key as previous marker)') |
|
|
|
params['marker'] = lastKey |