Encoding the slash in object names breaks when the object we're trying
to fetch is inside a folder. A side effect of this is that the cloud
sync module fails to sync folders and objects nested within.
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
{
string urlsafe_bucket, urlsafe_object;
url_encode(obj.bucket.get_key(':', 0), urlsafe_bucket);
- url_encode(obj.key.name, urlsafe_object);
+ // do not encode slash. It leads to 404 errors when fetching objects inside folders.
+ url_encode(obj.key.name, urlsafe_object, false);
*resource = urlsafe_bucket + "/" + urlsafe_object;
}