Closed
Description
Describe the bug
When sending POST requests to the GraphQL Servlet with Content-Type: application/graphql
it works as expected, when specifying a charset with Content-Type: application/grapql; charset=utf-8
it fails to recognize it and tries to handle it as a JSON body instead.
To Reproduce
Steps to reproduce the behavior:
- Make any queryable GraphQL Servlet
- Query it via POST with
Content-Type: application/graphql; charset=utf-8
GraphQLPostInvocationInputParser
fails to recognizeContent-Type
Header
Expected behavior
GraphQLPostInvocationInputParser
should be able to handle Content-Type
Headers containing additional information like charset
Additional context
Currently checking for Content-Type: application/graphql
in GraphQLPostInvocationInputParser
happens like this:
if (APPLICATION_GRAPHQL.equals(request.getContentType())) {
I would expect something more like this:
String contentType = request.getContentType();
if (contentType != null && APPLICATION_GRAPHQL.equals(contentType.split(";")[0])) {