Skip to content

Commit 0ecb8bc

Browse files
committed
s3: fix url decoding of NextMarker - fixes rclone#3799
Before this patch we were failing to URL decode the NextMarker when url encoding was used for the listing. The result of this was duplicated listings entries for directories with >1000 entries where the NextMarker was a file containing a space.
1 parent 1ab4985 commit 0ecb8bc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

backend/s3/s3.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,12 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck
13981398
} else {
13991399
marker = resp.NextMarker
14001400
}
1401+
if urlEncodeListings {
1402+
*marker, err = url.QueryUnescape(*marker)
1403+
if err != nil {
1404+
return errors.Wrapf(err, "failed to URL decode NextMarker %q", *marker)
1405+
}
1406+
}
14011407
}
14021408
return nil
14031409
}

0 commit comments

Comments
 (0)