Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public Object decode(Response response, Type type) throws IOException, DecodeExc
String contentType = getContentType(response);
MediaType mediaType = MediaType.parseMediaType(contentType);
String version = mediaType.getParameter("v");
if (version == null) {
if (version == null || "3".equals(version)) {
Object object = decoder.decode(response, ApiResponse.class);
if (object instanceof ApiResponse) {
return ApiResponse.class.cast(object).getBody();
Expand All @@ -58,7 +58,7 @@ public Object decode(Response response, Type type) throws IOException, DecodeExc
}

private String getContentType(Response response) {
Collection<String> types = response.headers().getOrDefault("Content-Type", Arrays.asList("application/json;v=3"));
Collection<String> types = response.request().headers().getOrDefault("Accept", Arrays.asList("application/json;v=3"));
return types.iterator().next();
}
}