diff --git a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/WasbRemoteCallHelper.java b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/WasbRemoteCallHelper.java index 09ea0847ee4..b43e5aec2a0 100644 --- a/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/WasbRemoteCallHelper.java +++ b/hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/WasbRemoteCallHelper.java @@ -88,7 +88,8 @@ class WasbRemoteCallHelper { } Header contentTypeHeader = response.getFirstHeader("Content-Type"); - if (contentTypeHeader == null || contentTypeHeader.getValue() != APPLICATION_JSON) { + if (contentTypeHeader == null + || !APPLICATION_JSON.equals(contentTypeHeader.getValue())) { throw new WasbRemoteCallException(getRequest.getURI().toString() + ":" + "Content-Type mismatch: expected: " + APPLICATION_JSON + ", got " + ((contentTypeHeader!=null) ? contentTypeHeader.getValue() : "NULL")