HADOOP-12088. KMSClientProvider uses equalsIgnoreCase("application/json"). (Brahma Reddy Battula via stevel)

This commit is contained in:
Steve Loughran 2015-07-20 13:02:51 +01:00
parent 208b9eed9e
commit d68b044f0f
2 changed files with 6 additions and 1 deletions

View File

@ -487,6 +487,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

View File

@ -544,7 +544,9 @@ public class KMSClientProvider extends KeyProvider implements CryptoExtension,
// 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;