Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-24 20:14:44 +0300
committerStan Hu <stanhu@gmail.com>2018-12-24 20:24:12 +0300
commite2179093b0e355da70889ee6d7191d33a4d9d687 (patch)
tree0219791b279a00960c4ba3515a5e52cf3365c6ce /config
parent5dc656fc1f053d397ad1e6c1d85a815f03a5d634 (diff)
Bump CarrierWave to 1.3.0 and remove monkey patches
Full list of changes: https://github.com/carrierwaveuploader/carrierwave/blob/master/CHANGELOG.md
Diffstat (limited to 'config')
-rw-r--r--config/initializers/carrierwave_patch.rb42
1 files changed, 0 insertions, 42 deletions
diff --git a/config/initializers/carrierwave_patch.rb b/config/initializers/carrierwave_patch.rb
deleted file mode 100644
index c361784491d..00000000000
--- a/config/initializers/carrierwave_patch.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-# This monkey patches CarrierWave 1.2.3 to make Google Cloud Storage work with
-# extra query parameters:
-# https://github.com/carrierwaveuploader/carrierwave/pull/2332/files
-module CarrierWave
- module Storage
- class Fog < Abstract
- class File
- def authenticated_url(options = {})
- if %w(AWS Google Rackspace OpenStack).include?(@uploader.fog_credentials[:provider])
- # avoid a get by using local references
- local_directory = connection.directories.new(key: @uploader.fog_directory)
- local_file = local_directory.files.new(key: path)
- expire_at = ::Fog::Time.now + @uploader.fog_authenticated_url_expiration
- case @uploader.fog_credentials[:provider]
- when 'AWS', 'Google'
- local_file.url(expire_at, options)
- when 'Rackspace'
- connection.get_object_https_url(@uploader.fog_directory, path, expire_at, options)
- when 'OpenStack'
- connection.get_object_https_url(@uploader.fog_directory, path, expire_at)
- else
- local_file.url(expire_at)
- 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
-end