aws / aws-sdk-go

AWS SDK for the Go programming language.

Home Page:http://aws.amazon.com/sdk-for-go/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Utility for S3 URL encoding

devnev opened this issue · comments

Describe the feature

The CopyObject and UploadPartCopy APIs specify that the CopySource value must be "URL-encoded" but are not specific about what that means exactly. Various past issues have been raised as people have encountered the subtleties of this encoding, but conclusion was that the SDK could not be changed to automatically encode these values. However, the SDK could separately provide suitable encoding functions, especially as there seems to be no guidance on what exactly needs encoding, and it doesn't seem to match any of the available encoding functions in the Go standard library.

Use Case

I would like to use the AWS SDK to copy any objects without running into encoding issues.

Proposed Solution

A function somewhere in the features/s3 (sub)packages that properly encodes any valid S3 key for use in the CopySource field of CopyObject and UploadPartCopy

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

aws-sdk-go-v2@v1.39.0

Environment details (Version of Go (go version)? OS name and version, etc.)

go version go1.21.0 darwin/amd64

Hi @devnev ,

Can you please give us a concrete example of how the lack of encoding is preventing you from achieving what you are trying to do?

A code example with expected vs actual result would be really helpful.

Thanks,
Ran~

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.