diff options
author | Sean McGivern <sean@gitlab.com> | 2018-12-18 11:55:33 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2018-12-18 11:55:33 +0300 |
commit | 651d12645b28a05a5a20734c5b3019b71eaa3dd2 (patch) | |
tree | 62d3a959aecd00d0ea5537f3a7269679073ae77c /config | |
parent | 41a942bedaa9ef003a5a2579d3f7d986c506818d (diff) | |
parent | 79a091b12aab9c41085840eb7db28d9787dd2573 (diff) |
Merge branch 'sh-carrierwave-patch-google-acl' into 'master'
Fix object storage not working properly with Google S3 compatibility
Closes #53846
See merge request gitlab-org/gitlab-ce!23858
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/carrierwave_patch.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/carrierwave_patch.rb b/config/initializers/carrierwave_patch.rb index 35ffff03abe..c361784491d 100644 --- a/config/initializers/carrierwave_patch.rb +++ b/config/initializers/carrierwave_patch.rb @@ -23,6 +23,19 @@ module CarrierWave end end end + + # Fix for https://github.com/carrierwaveuploader/carrierwave/pull/2356 + def acl_header + if fog_provider == 'AWS' + { 'x-amz-acl' => @uploader.fog_public ? 'public-read' : 'private' } + else + {} + end + end + + def fog_provider + @uploader.fog_credentials[:provider].to_s + end end end end |