Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 8cda73e

Browse files
authored
Don't reuse global headers for Json parts
This PR #176 introduced a bug where the global `Content-Type` header for multipart requests was forced to `application/json;charset=UTF-8` instead of `multipart/form-data`. This makes the query parser fail.
1 parent 078b2c4 commit 8cda73e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql-spring-boot-test/src/main/java/com/graphql/spring/boot/test/RequestFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ static HttpEntity<Object> forJson(String json, HttpHeaders headers) {
1919
static HttpEntity<Object> forMultipart(String query, String variables, HttpHeaders headers) {
2020
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
2121
LinkedMultiValueMap<String, Object> values = new LinkedMultiValueMap<>();
22-
values.add("query", forJson(query, headers));
23-
values.add("variables", forJson(variables, headers));
22+
values.add("query", forJson(query, new HttpHeaders()));
23+
values.add("variables", forJson(variables, new HttpHeaders()));
2424
return new HttpEntity<>(values, headers);
2525
}
2626

0 commit comments

Comments
 (0)