Skip to content

Commit

Permalink
Fix json encoding to string.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Leduc-Hamel committed Mar 8, 2021
1 parent b90c9b2 commit 812b760
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/store/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ func (s *S3) Persist(ctx context.Context, data *Data) error {
return err
}

s.cfg.Logger().Debug().Str("key", key).Msg("Starting Persistence")
bodyStr := string(body)

s.cfg.Logger().Debug().Str("key", key).Str("body", bodyStr).Msg("Starting Persistence")
_, err = s.client.PutObjectWithContext(ctx, &s3.PutObjectInput{
Bucket: aws.String(s.cfg.S3Bucket()),
Key: aws.String(key),
Body: strings.NewReader(fmt.Sprintf("%v", body)),
Body: strings.NewReader(bodyStr),
GrantRead: aws.String("GrantRead"),
ContentType: aws.String("application/json"),
})
Expand Down

0 comments on commit 812b760

Please sign in to comment.