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

This commit is contained in:
Mingliang Liu 2017-04-04 11:03:59 -07:00
parent 6eba79232f
commit 27a44b60c1

View File

@ -88,7 +88,8 @@ public String makeRemoteGetRequest(HttpGet getRequest)
}
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")