From ac52d8d3c7c66c53f59e99679633dd567e9ec01d Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Mon, 1 Oct 2018 19:03:02 +0800 Subject: [PATCH] Fix `UploadRecovery` from S3 fails with bucket name containing sub-folder. --- lib/upload_recovery.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/upload_recovery.rb b/lib/upload_recovery.rb index 3ab5da75f83..6ec35141586 100644 --- a/lib/upload_recovery.rb +++ b/lib/upload_recovery.rb @@ -165,7 +165,7 @@ class UploadRecovery if key =~ /#{sha1}/ tombstone_prefix = FileStore::S3Store::TOMBSTONE_PREFIX - if key.starts_with?(tombstone_prefix) + if key.include?(tombstone_prefix) old_key = key key = key.sub(tombstone_prefix, "")