diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 18475b96d1..bfa9aac0fa 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -975,6 +975,9 @@ Release 2.8.0 - UNRELEASED HADOOP-12209 Comparable type should be in FileStatus. (Yong Zhang via stevel) + HADOOP-12088. KMSClientProvider uses equalsIgnoreCase("application/json"). + (Brahma Reddy Battula via stevel) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java index 223e69a1a8..1ffc44d049 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/key/kms/KMSClientProvider.java @@ -544,7 +544,9 @@ private T call(HttpURLConnection conn, Map jsonOutput, // AuthenticatedURL properly to set authToken post initialization) } HttpExceptionUtils.validateResponse(conn, expectedResponse); - if (APPLICATION_JSON_MIME.equalsIgnoreCase(conn.getContentType()) + if (conn.getContentType() != null + && conn.getContentType().trim().toLowerCase() + .startsWith(APPLICATION_JSON_MIME) && klass != null) { ObjectMapper mapper = new ObjectMapper(); InputStream is = null;