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

Add protocol tests for Content-Type params #2296

Merged
merged 2 commits into from
Jun 3, 2024
Merged

Conversation

djedward
Copy link
Contributor

Background

This change adds tests to document/enforce how the Content-Type headers should be handled by servers. They are important to ensure that clients get the same experience regardless of which language the server is written in.

These are being added as smithy-rs was rejecting requests with parameters added to the Content-Type header, but the customer's existing requests were being accepted by existing servers.

Testing

Links


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@djedward djedward requested a review from a team as a code owner May 22, 2024 18:41
@djedward djedward requested a review from syall May 22, 2024 18:41
@kstich kstich requested review from a team and sugmanue and removed request for a team and syall June 3, 2024 16:07
@sugmanue sugmanue merged commit 6506f1f into smithy-lang:main Jun 3, 2024
13 checks passed
github-merge-queue bot pushed a commit to smithy-lang/smithy-rs that referenced this pull request Jun 28, 2024
Fixes: #3471

## Motivation and Context
An issue was raised about a mobile client that appends "; charset=utf-8"
to the Content-Type when using restJson1. The [latest
RFC](https://www.rfc-editor.org/rfc/rfc8259) for "application/json" does
not register a charset parameter, but indicates it is reasonable to
accept it.

## Description
This change loosens the validation of the expected content type to allow
all parameters.

## Testing
* Tests for each protocol were added to
[smithy](smithy-lang/smithy#2296)
* ran the runtime and codegen tests
* Added test for rest-xml, as smithy-rs does not currently run the
smithy tests.

## Checklist
<!--- If a checkbox below is not applicable, then please DELETE it
rather than leaving it unchecked -->
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the
smithy-rs codegen or runtime crates
- [x] I have updated `CHANGELOG.next.toml` if I made changes to the AWS
SDK, generated SDK code, or SDK runtime crates

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
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