aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

Mimetype set in the return value of AsyncRequestBody.fromString(String string, Charset cs) ignores Charset.

Open k163377 opened this issue 3 years ago • 4 comments

Describe the bug

SSIA

Expected Behavior

text/plain; charset=${input} is set.

Current Behavior

text/plain; charset=UTF-8 is always set.

Reproduction Steps

Execute the following code https://github.com/aws/aws-sdk-java-v2/blob/2879b9581a5c4427665ce111478c81d0630cbb71/core/sdk-core/src/main/java/software/amazon/awssdk/core/async/AsyncRequestBody.java#L117-L127

Possible Solution

Set appropriate values from input.

Additional Information/Context

No response

AWS Java SDK version used

2.17.264

JDK version used

unrelated

Operating System and version

unrelated

k163377 avatar Sep 01 '22 09:09 k163377

Hello @k163377 ,

Thank you very much for your submission. The team is currently reviewing the behavior you are experiencing. I will update you on the status of this issue here.

Best,

Yasmine

yasminetalby avatar Sep 02 '22 20:09 yasminetalby

Hello @k163377 ,

The team would like to know what is your use case and how this limitation is impacting you. Could you please provide this information?

Thank you very much for your time and collaboration. Sincerely,

Yasmine

yasminetalby avatar Sep 06 '22 18:09 yasminetalby

The use case is to upload information with a charset other than UTF-8, as reported.

If the wrong charset is set here, the original charset information will be lost. This value is also set in HTTP headers and so on. This means that all systems accessing this file may try to read it with the wrong charset.

This behavior is undesirable, since charset other than UTF-8 is in common use worldwide.

k163377 avatar Sep 06 '22 19:09 k163377

Hello @k163377 ,

I have transferred this information to the team, I will post all updates regarding this issue here. Thank you very much for your rapid response and collaboration.

Sincerely,

Yasmine

yasminetalby avatar Sep 06 '22 19:09 yasminetalby

Fix merged, and will be go out with the next SDK release.

millems avatar Sep 28 '22 22:09 millems

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Sep 28 '22 22:09 github-actions[bot]