Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteGetObjectResponseRequest: Content-Type #2035

Open
scottpakula opened this issue Aug 16, 2022 · 1 comment
Open

WriteGetObjectResponseRequest: Content-Type #2035

scottpakula opened this issue Aug 16, 2022 · 1 comment
Labels
bug This issue is a bug. needs-reproduction This issue needs reproduction. p2 This is a standard priority issue

Comments

@scottpakula
Copy link

scottpakula commented Aug 16, 2022

Describe the bug

I have ran into an issue with 1.9.220 of the aws-sdk-cpp when using the WriteGetObjectResponseRequest and attempting to configure the Content-Type. When setting it . When reviewing the issues, I had found: WriteGetObjectResponseRequest: Content-Type #1665, but the ticket was already closed. I would like reopen it.

Expected Behavior

I'd like to set the content-type to be something other than just "text/plain"

Current Behavior

The content-type is always text/plain

Reproduction Steps

  S3::Model::WriteGetObjectResponseRequest request;
  request.WithRequestRoute(route);
  request.WithRequestToken(token);
  request.SetBody(objectStream);
  request.SetContentType("application/json"); // <-- curl -v show "text/plain" instead
  auto outcome = client.WriteGetObjectResponse(request);

Possible Solution

N/A

Additional Information/Context

No response

AWS CPP SDK version used

1.9.220

Compiler and Version used

9.4.0

Operating System and version

Ubuntu Linux 20.04

@scottpakula scottpakula added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 16, 2022
@vudh1 vudh1 self-assigned this Aug 22, 2022
@vudh1 vudh1 assigned jmklix and unassigned vudh1 Sep 9, 2022
@jmklix jmklix added p2 This is a standard priority issue needs-reproduction This issue needs reproduction. and removed needs-triage This issue or PR still needs to be triaged. labels Nov 18, 2022
@yasminetalby yasminetalby assigned yasminetalby and unassigned jmklix Jun 22, 2023
@scottpakula
Copy link
Author

scottpakula commented Sep 24, 2024

It seems that the root cause of this issue is that Content-Type is simply not set in aws-cpp-sdk-s3/source/model/WriteGetObjectResponseRequest.cpp. I patched in the following to correct the issue:
{ ss << GetContentType(); headers.emplace("x-amz-fwd-header-content-type", ss.str()); ss.str(""); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. needs-reproduction This issue needs reproduction. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

4 participants