Skip to content

Custom Request Header with S3 Manager Uploader #2113

Answered by dreamerm99
dreamerm99 asked this question in Q&A
Discussion options

You must be logged in to vote

actually figured it out. In case anyone is having trouble with this. I was finally able to inject custom headers.

var s3func = func(options *s3.Options) {
	for k, v := range input.ReqHeaders {
		options.APIOptions = append(options.APIOptions, smithyhttp.AddHeaderValue(k, v))
	}
}

response.Response, err = s.Uploader.Upload(ctx, &s3.PutObjectInput{
	Bucket: aws.String(input.Bucket),
	Key:    aws.String(input.Key),
	Body: input.Content,

},
	s3manager.WithUploaderRequestOptions(s3func),
)

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dreamerm99
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant