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

When checking the Accept header the charset is expected to be utf8 not utf-8 #120

Closed
pkqk opened this issue Apr 10, 2024 · 2 comments
Closed
Labels
bug Something isn't working released Has been released and published

Comments

@pkqk
Copy link

pkqk commented Apr 10, 2024

Expected Behaviour
A request with the HTTP header:

Accept: application/json; charset=utf-8

is accepted as a GraphQL request

Actual Behaviour
The request is rejected with:

HTTP 406 Not Acceptable

Debug Information
I think the check here is wrong and should be looking for utf-8 not utf8.
https://github.com/graphql/graphql-http/blob/v1.22.0/src/handler.ts#L593

@enisdenjo enisdenjo added the bug Something isn't working label Apr 10, 2024
enisdenjo pushed a commit that referenced this issue Apr 10, 2024
## [1.22.1](v1.22.0...v1.22.1) (2024-04-10)

### Bug Fixes

* **audit/render:** Omit `set-cookie` header and html body ([#116](#116)) ([1c5c744](1c5c744))
* **handler:** Support both utf-8 and utf8 charsets ([94100d6](94100d6)), closes [#120](#120)
* **use:** Set request readable encoding to utf-8 ([50d3bcd](50d3bcd)), closes [#118](#118)
@enisdenjo
Copy link
Member

🎉 This issue has been resolved in version 1.22.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@enisdenjo enisdenjo added the released Has been released and published label Apr 10, 2024
@enisdenjo
Copy link
Member

enisdenjo commented Apr 10, 2024

Thank you for bringing this up! v1.22.1 now includes a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Has been released and published
Projects
None yet
Development

No branches or pull requests

2 participants