Skip to content

Commit

Permalink
Merge pull request #163 from rebuy-de/fix-s3
Browse files Browse the repository at this point in the history
fix S3 with empty directories
  • Loading branch information
svenwltr committed Mar 22, 2018
2 parents 9c0b33e + 865e7a4 commit 3ebe024
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/awsutil/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,23 @@ func (c *Credentials) NewSession(region string) (*session.Session, error) {

case c.HasProfile():
opts = session.Options{
Config: aws.Config{
Region: aws.String(region),
},
SharedConfigState: session.SharedConfigEnable,
Profile: c.Profile,
}

case c.HasKeys():
opts = session.Options{
Config: aws.Config{
Region: aws.String(region),
Credentials: credentials.NewStaticCredentials(
strings.TrimSpace(c.AccessKeyID),
strings.TrimSpace(c.SecretAccessKey),
strings.TrimSpace(c.SessionToken),
)}}
}

opts.Config.Region = aws.String(region)
opts.Config.DisableRestProtocolURICleaning = aws.Bool(true)

sess, err := session.NewSessionWithOptions(opts)
if err != nil {
return nil, err
Expand Down

0 comments on commit 3ebe024

Please sign in to comment.