diff --git a/stage-1/src/biz-project/biz-api/src/main/java/com/acme/biz/api/openfeign/ApiResponseDecoder.java b/stage-1/src/biz-project/biz-api/src/main/java/com/acme/biz/api/openfeign/ApiResponseDecoder.java index fbfd8f0..953c4e4 100644 --- a/stage-1/src/biz-project/biz-api/src/main/java/com/acme/biz/api/openfeign/ApiResponseDecoder.java +++ b/stage-1/src/biz-project/biz-api/src/main/java/com/acme/biz/api/openfeign/ApiResponseDecoder.java @@ -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(); @@ -58,7 +58,7 @@ public Object decode(Response response, Type type) throws IOException, DecodeExc } private String getContentType(Response response) { - Collection types = response.headers().getOrDefault("Content-Type", Arrays.asList("application/json;v=3")); + Collection types = response.request().headers().getOrDefault("Accept", Arrays.asList("application/json;v=3")); return types.iterator().next(); } }