Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[match] prevent directory download from s3 #20975

Merged
4 changes: 4 additions & 0 deletions match/lib/match/storage/s3_storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ def download
self.working_directory = Dir.mktmpdir

s3_client.find_bucket!(s3_bucket).objects(prefix: s3_object_prefix).each do |object|

# prevent download if file_path is a dir
next if object.key.end_with?("/")
markhomoki marked this conversation as resolved.
Show resolved Hide resolved

file_path = strip_s3_object_prefix(object.key) # :s3_object_prefix:team_id/path/to/file

# strip s3_prefix from file_path
Expand Down