From c53ac4523e978d0f3827f5f4d8126bb3c18bc033 Mon Sep 17 00:00:00 2001 From: hasonmsft Date: Wed, 21 Dec 2016 17:55:11 +0800 Subject: [PATCH] For response has body and no `content-type` header, try to parse the body using xml format. --- ChangeLog.md | 1 + lib/common/services/storageserviceclient.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 02a0679..5df3096 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,7 @@ ALL * Fixed the issue that `BatchOperation` doesn't support socket reuse for some node versions. * Fixed the issue that `BatchOperation` request pool size is too big when the socket reuse is supported. * Added empty headers to string-to-sign. +* For response has body and no `content-type` header, try to parse the body using xml format. BLOB * Added support for large block blob. diff --git a/lib/common/services/storageserviceclient.js b/lib/common/services/storageserviceclient.js index 36af1a8..e11f7be 100644 --- a/lib/common/services/storageserviceclient.js +++ b/lib/common/services/storageserviceclient.js @@ -846,7 +846,8 @@ StorageServiceClient._parseResponse = function (response, xml2jsSettings, option } else if (contentType.indexOf('text/html') !== -1) { response.body = response.body; } else { - throw new SyntaxError(SR.CONTENT_TYPE_MISSING, null); + response.body = parseXml(response.body); + // throw new SyntaxError(SR.CONTENT_TYPE_MISSING, null); } } catch (e) { response.error = e;