s3: fix url decoding of NextMarker - fixes #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.
This commit is contained in:
Nick Craig-Wood 2019-12-11 17:23:52 +00:00
parent 1ab4985046
commit 0ecb8bc2f9
1 changed files with 6 additions and 0 deletions

View File

@ -1398,6 +1398,12 @@ func (f *Fs) list(ctx context.Context, bucket, directory, prefix string, addBuck
} else {
marker = resp.NextMarker
}
if urlEncodeListings {
*marker, err = url.QueryUnescape(*marker)
if err != nil {
return errors.Wrapf(err, "failed to URL decode NextMarker %q", *marker)
}
}
}
return nil
}