From f7f74b1ec0002c45fef66ccf65d9e1be986eff6f Mon Sep 17 00:00:00 2001 From: Lars Hagen Date: Tue, 24 Oct 2023 11:27:41 +0200 Subject: [PATCH] Restore OPAQUE_MARKERS handling for list objects V1 We need this to support V1 clients that use the last object name in the response as a marker for the next page (which is allowed according to the S3 docs). --- src/main/java/org/gaul/s3proxy/S3ProxyHandler.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java index 3396ebc7..a0b64cdf 100644 --- a/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java +++ b/src/main/java/org/gaul/s3proxy/S3ProxyHandler.java @@ -1490,8 +1490,12 @@ private void handleBlobList(HttpServletRequest request, if (Quirks.OPAQUE_MARKERS.contains(blobStoreType)) { StorageMetadata sm = Streams.findLast(set.stream()).orElse(null); if (sm != null) { - lastKeyToMarker.put(Maps.immutableEntry(containerName, - encodeBlob(encodingType, nextMarker)), nextMarker); + // TODO: verify if we need this handling at all for V2 + String lastKey = isListV2 ? encodeBlob(encodingType, nextMarker) : sm.getName(); + lastKeyToMarker.put( + Maps.immutableEntry(containerName, lastKey), + nextMarker + ); } } } else {