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

Match Content-Type charset case-insensitively #440

Merged

Conversation

ichizero
Copy link
Contributor

The connect handler returns http.StatusUnsupportedMediaType when a request has a Content-Type: application/json; charset=UTF-8 header. However, according to RFC 9110 Section 8.3.2, the charset parameter value should be treated as case-insensitive.

In this PR, I have modified the charset parameter value for user requests and acceptable content types of handlers to all be handled in lowercase.

Copy link
Member

@akshayjshah akshayjshah left a comment

Choose a reason for hiding this comment

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

This is great - thank you, @ichizero!

@akshayjshah akshayjshah changed the title Treat the charset parameter value of the Content-Type header as case-insensitive Match Content-Type charset case-insensitively Jan 26, 2023
@akshayjshah akshayjshah merged commit 15a843b into connectrpc:main Jan 26, 2023
renovate bot referenced this pull request in open-feature/flagd Jan 27, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[github.com/bufbuild/connect-go](https://togithub.com/bufbuild/connect-go)
| require | minor | `v1.4.1` -> `v1.5.0` |

---

### Release Notes

<details>
<summary>bufbuild/connect-go</summary>

###
[`v1.5.0`](https://togithub.com/bufbuild/connect-go/releases/tag/v1.5.0)

[Compare
Source](https://togithub.com/bufbuild/connect-go/compare/v1.4.1...v1.5.0)

#### What's Changed

##### Enhancements

- Add NewWireError for propagating partial stream failures by
[@&#8203;akshayjshah](https://togithub.com/akshayjshah) in
[https://github.com/bufbuild/connect-go/pull/437](https://togithub.com/bufbuild/connect-go/pull/437)

##### Bugfixes

- Match Content-Type charset case-insensitively by
[@&#8203;ichizero](https://togithub.com/ichizero) in
[https://github.com/bufbuild/connect-go/pull/440](https://togithub.com/bufbuild/connect-go/pull/440)

#### New Contributors

- [@&#8203;ichizero](https://togithub.com/ichizero) made their first
contribution in
[https://github.com/bufbuild/connect-go/pull/440](https://togithub.com/bufbuild/connect-go/pull/440)

**Full Changelog**:
bufbuild/connect-go@v1.4.1...v1.5.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/open-feature/flagd).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMTEuMSIsInVwZGF0ZWRJblZlciI6IjM0LjExMS4xIn0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
akshayjshah pushed a commit that referenced this pull request Jul 26, 2023
The connect handler returns http.StatusUnsupportedMediaType when a
request has a `Content-Type: application/json; charset=UTF-8` header.
However, according to [RFC 9110 Section 8.3.2](
https://httpwg.org/specs/rfc9110.html#rfc.section.8.3.2), the charset
parameter value should be treated as case-insensitive.

In this PR, I have modified the charset parameter value for user
requests and acceptable content types of handlers to all be handled in
lowercase.
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.

2 participants