|
4 | 4 | import graphql.GraphQLException;
|
5 | 5 | import graphql.kickstart.execution.input.GraphQLInvocationInput;
|
6 | 6 | import java.io.IOException;
|
| 7 | +import java.nio.charset.StandardCharsets; |
7 | 8 | import javax.servlet.http.HttpServletRequest;
|
8 | 9 | import javax.servlet.http.HttpServletResponse;
|
9 | 10 | import lombok.extern.slf4j.Slf4j;
|
@@ -32,14 +33,17 @@ public HttpRequestHandlerImpl(
|
32 | 33 | @Override
|
33 | 34 | public void handle(HttpServletRequest request, HttpServletResponse response) throws IOException {
|
34 | 35 | try {
|
| 36 | + if (request.getCharacterEncoding() == null) { |
| 37 | + request.setCharacterEncoding(StandardCharsets.UTF_8.name()); |
| 38 | + } |
35 | 39 | GraphQLInvocationInputParser invocationInputParser =
|
36 | 40 | GraphQLInvocationInputParser.create(
|
37 | 41 | request,
|
38 | 42 | configuration.getInvocationInputFactory(),
|
39 | 43 | configuration.getObjectMapper(),
|
40 | 44 | configuration.getContextSetting());
|
41 | 45 | GraphQLInvocationInput invocationInput =
|
42 |
| - invocationInputParser.getGraphQLInvocationInput(request, response); |
| 46 | + invocationInputParser. getGraphQLInvocationInput(request, response); |
43 | 47 | requestInvoker.execute(invocationInput, request, response);
|
44 | 48 | } catch (GraphQLException | JsonProcessingException e) {
|
45 | 49 | response.setStatus(STATUS_BAD_REQUEST);
|
|
0 commit comments