Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d5043424
Commit
d5043424
authored
Mar 01, 2018
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch Fog/Google/AWS to add additional delete_url method
parent
674be13f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
0 deletions
+57
-0
config/initializers/carrierwave_delete_url_fog_aws.rb
config/initializers/carrierwave_delete_url_fog_aws.rb
+31
-0
config/initializers/carrierwave_delete_url_fog_google.rb
config/initializers/carrierwave_delete_url_fog_google.rb
+26
-0
No files found.
config/initializers/carrierwave_delete_url_fog_aws.rb
0 → 100644
View file @
d5043424
require
'fog/aws'
# Hot patching the fog-aws to enable
# https://github.com/fog/fog-google/pull/306
#
# To be removed once the new version of fog-google is released
module
Fog
module
Storage
class
AWS
class
Real
def
delete_object_url
(
bucket_name
,
object_name
,
expires
,
headers
=
{},
options
=
{})
unless
bucket_name
raise
ArgumentError
.
new
(
'bucket_name is required'
)
end
unless
object_name
raise
ArgumentError
.
new
(
'object_name is required'
)
end
signed_url
(
options
.
merge
({
bucket_name:
bucket_name
,
object_name:
object_name
,
method:
'DELETE'
,
headers:
headers
}),
expires
)
end
end
end
end
end
config/initializers/carrierwave_delete_url_fog_google.rb
0 → 100644
View file @
d5043424
require
'fog/google'
# Hot patching the fog-google to enable
# https://github.com/fog/fog-aws/pull/431
#
# To be removed once the new version of fog-aws is released
module
Fog
module
Storage
class
GoogleXML
class
Real
def
delete_object_url
(
bucket_name
,
object_name
,
expires
)
raise
ArgumentError
.
new
(
"bucket_name is required"
)
unless
bucket_name
raise
ArgumentError
.
new
(
"object_name is required"
)
unless
object_name
https_url
({
headers:
{},
host:
@host
,
method:
"DELETE"
,
path:
"
#{
bucket_name
}
/
#{
object_name
}
"
},
expires
)
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment