Conversation
|
👍 Looks like a good solution to me, especially since it used to work this way. It'd be nice to get a test for it though, so we don't regress again. How did this surface in practice? |
|
Oh yeah I'll add a test. This surfaced for requests with the |
The rewritten lexer in #4369 removed UTF8 forced encoding. It's possible for applications to force encoding document strings themselves before passing it to the GraphQL gem, but it should be done at this layer to ensure that invalid encoding is properly handled.
3dc76a4 to
4220dc3
Compare
|
Added a test. Without force encoding, the first token would be |
|
Thanks for taking care of this! |
|
Sorry, I didn't see this issue. I don't think this is the right thing to do. According to the spec, GraphQL queries "are expressed as a sequence of Unicode characters". When someone sends a query to the GraphQL parser, it's up to them to ensure that the input string is valid UTF-8 encoding. Imagine a situation where someone makes an HTTP Post with a Using |
The rewritten lexer in #4369 removed UTF8 forced encoding.
It's possible for applications to force encode document strings themselves before passing it to the GraphQL gem, but it should be done at this layer to ensure that invalid encoding is properly handled.
Two questions:
cc @tenderlove