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

Better handling of Accept headers #431

Merged
merged 2 commits into from
Sep 27, 2021

Conversation

adamthom-amzn
Copy link
Contributor

Description of changes:
Currently, we do an exact-match of the Accept header (if present) against the document media type for the protocol. Accept headers can be much more complicated than a single media type, so we must parse it to be sure that the client cannot handle our preferred response type before sending a 406 response.

I tested this by regenerating and re-running the server protocol tests against the tip of the SDK's main. They pass.

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

Accept values can have wildcards, and multiple types can be specified in the
header. Use a helper function to handle all the possible permutations
specified in https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2
@adamthom-amzn adamthom-amzn requested review from JordonPhillips, gosar and a team September 24, 2021 23:30
@adamthom-amzn adamthom-amzn merged commit 5a242c7 into smithy-lang:main Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants