You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected Behaviour
One expects the default/fallback behaviour to correctly assemble UTF-8 multibyte characters in the request body.
Actual Behaviour
The default/fallback behaviour incorrectly assembles requests that exceed the input stream chunk size. Multibyte characters that straddle chunks are incorrectly parsed, resulting in replacement characters or arbitrary single byte characters.
Debug Information
Send an HTTP request with a variable assigned to a large number of fx "å" that exceeds the request body stream high-water mark. The value passed to the schema will be intermittently corrupted.
Further Information
It appears as though simply calling req.setEncoding("utf8"); is enough to address the issue.
The text was updated successfully, but these errors were encountered:
Hey there, thanks for opening this issue and for the great find! A PR would be very welcome and appreciated if willing; no worries though, otherwise I'll handle it. 👍
## [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)
Expected Behaviour
One expects the default/fallback behaviour to correctly assemble UTF-8 multibyte characters in the request body.
Actual Behaviour
The default/fallback behaviour incorrectly assembles requests that exceed the input stream chunk size. Multibyte characters that straddle chunks are incorrectly parsed, resulting in replacement characters or arbitrary single byte characters.
Example: https://github.com/graphql/graphql-http/blob/main/src/use/http.ts#L144-L146
Debug Information
Send an HTTP request with a variable assigned to a large number of fx "å" that exceeds the request body stream high-water mark. The value passed to the schema will be intermittently corrupted.
Further Information
It appears as though simply calling
req.setEncoding("utf8");
is enough to address the issue.The text was updated successfully, but these errors were encountered: