Skip to content

Commit

Permalink
Merge pull request #124 from nhandler/110-optional-acl
Browse files Browse the repository at this point in the history
Don't Specify an ACL by Default (Fixes #110)
  • Loading branch information
rajatharanganath authored Sep 1, 2023
2 parents fe9d75b + 9070b33 commit ab94fa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ func main() {
cli.StringFlag{
Name: "acl",
Usage: "upload files with acl",
Value: "private",
EnvVar: "PLUGIN_ACL",
},
cli.StringFlag{
Expand Down
5 changes: 4 additions & 1 deletion plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ func (p *Plugin) Exec() error {
Body: f,
Bucket: &(p.Bucket),
Key: &target,
ACL: &(p.Access),
}

if contentType != "" {
Expand All @@ -220,6 +219,10 @@ func (p *Plugin) Exec() error {
putObjectInput.StorageClass = &(p.StorageClass)
}

if p.Access != "" {
putObjectInput.ACL = &(p.Access)
}

_, err = client.PutObject(putObjectInput)

if err != nil {
Expand Down

0 comments on commit ab94fa2

Please sign in to comment.