1
0
فهرست منبع

HADOOP-14272. Azure: WasbRemoteCallHelper should use String equals for comparison. Contributed by Santhosh G Nayak

Mingliang Liu 8 سال پیش
والد
کامیت
27a44b60c1
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      hadoop-tools/hadoop-azure/src/main/java/org/apache/hadoop/fs/azure/WasbRemoteCallHelper.java

+ 2 - 1
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")