Skip to content

A platform for community discussion. Free, open, simple.

FIX: Add bucket folder path only if not exists

Vinoth Kannanbe0555cc17ce
diff --git a/lib/s3_helper.rb b/lib/s3_helper.rb
index 3706b24868a..6349fb9ba33 100644
--- a/lib/s3_helper.rb
+++ b/lib/s3_helper.rb
@@ -238,7 +238,7 @@ class S3Helper
end
def get_path_for_s3_upload(path)
- path = File.join(@s3_bucket_folder_path, path) if @s3_bucket_folder_path
+ path = File.join(@s3_bucket_folder_path, path) if @s3_bucket_folder_path && path !~ /^#{@s3_bucket_folder_path}\//
path
end