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 {