diff --git a/lib/carrierwave/storage/fog.rb b/lib/carrierwave/storage/fog.rb index 8bc04ae93..128334289 100644 --- a/lib/carrierwave/storage/fog.rb +++ b/lib/carrierwave/storage/fog.rb @@ -497,6 +497,8 @@ def file def acl_header if fog_provider == 'AWS' { 'x-amz-acl' => @uploader.fog_public ? 'public-read' : 'private' } + elsif fog_provider == "Google" + @uploader.fog_public ? { destination_predefined_acl: "publicRead" } : {} else {} end diff --git a/spec/storage/fog_helper.rb b/spec/storage/fog_helper.rb index 3a3622aa7..090a05a5b 100644 --- a/spec/storage/fog_helper.rb +++ b/spec/storage/fog_helper.rb @@ -69,6 +69,9 @@ def check_file if @provider == 'AWS' expect(@storage.connection).to receive(:copy_object) .with(anything, anything, anything, anything, { "x-amz-acl"=>"public-read" }).and_call_original + elsif @provider == 'Google' + expect(@storage.connection).to receive(:copy_object) + .with(anything, anything, anything, anything, { destination_predefined_acl: "publicRead" }).and_call_original else expect(@storage.connection).to receive(:copy_object) .with(anything, anything, anything, anything, {}).and_call_original