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

Fix duplicate content-type in server response #1163

Merged
merged 1 commit into from
Feb 7, 2022

Conversation

guymguym
Copy link
Contributor

@guymguym guymguym commented Feb 7, 2022

Signed-off-by: Guy Margalit [email protected]

Motivation and Context

  • Content-Type header was set twice in the server response to S3 GetObject/HeadObject causing the client to fail.
  • This happens for operations that bind an output member to the content-type header.
  • Even though the call to set_response_header_if_absent checks for dup header, it was called before the output members, and the output members code did not check for dups, and added the header twice.

Description

  • By replacing the order so that the default content-type is added after setting the output members and only if absent, the duplicate is detected on runtime and avoided.

Testing

  • Tested with S3 GetObject

Checklist

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@guymguym guymguym requested a review from a team as a code owner February 7, 2022 08:52
Copy link
Contributor

@david-perez david-perez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@guymguym Thank you.

I've made a note in #1164 (comment) to ensure we don't forget to add a protocol test to not regress on this, once we have the "extras" suite hooked up.

@david-perez david-perez merged commit 2a68774 into smithy-lang:main Feb 7, 2022
@crisidev crisidev added server Rust server SDK bug Something isn't working labels Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Rust server SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants