fix the xmlbuilder bug (#5182)
This commit is contained in:
Родитель
552cb002b1
Коммит
369fbc15dd
|
@ -320,11 +320,10 @@ _.extend(exports, {
|
|||
throw new Error('Invalid XML root element.');
|
||||
}
|
||||
|
||||
var doc = xmlbuilder.create();
|
||||
|
||||
var rootElementName = azureutil.objectFirstKey(entity);
|
||||
|
||||
doc = doc.begin(rootElementName, { version: '1.0', encoding: 'utf-8', standalone: 'yes' });
|
||||
var doc = xmlbuilder.create(rootElementName, { version: '1.0', encoding: 'utf-8', standalone: 'yes' });
|
||||
|
||||
if (entity[rootElementName][Constants.XML_METADATA_MARKER]) {
|
||||
for (var metadata in entity[rootElementName][Constants.XML_METADATA_MARKER]) {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
'use strict';
|
||||
|
||||
var XMLBuilder = require('xmlbuilder/lib/XMLBuilder');
|
||||
var XMLBuilder = require('xmlbuilder/lib/XMLStringifier');
|
||||
|
||||
// Patch xmlbuilder to allow Unicode surrogate pair code
|
||||
// points in XML bodies
|
||||
|
@ -28,4 +28,5 @@ XMLBuilder.prototype.assertLegalChar = function(str) {
|
|||
if (chr) {
|
||||
throw new Error('Invalid character (' + chr + ') in string: ' + str);
|
||||
}
|
||||
return str;
|
||||
};
|
|
@ -11,7 +11,7 @@
|
|||
"Tavares, Chris <ctavares@microsoft.com>",
|
||||
"Kulshrestha, Ankur <ankurkul@microsoft.com>"
|
||||
],
|
||||
"version": "0.9.23",
|
||||
"version": "0.9.25",
|
||||
"description": "Microsoft Azure Common Client Library for node",
|
||||
"tags": [
|
||||
"azure",
|
||||
|
@ -46,4 +46,4 @@
|
|||
"scripts": {
|
||||
"test": "npm -s run-script jshint"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,8 +40,7 @@ function BlockListResult(committedBlocks, uncommittedBlocks, latestBlocks) {
|
|||
* @return {string} The XML block list.
|
||||
*/
|
||||
BlockListResult.serialize = function (blockListJs) {
|
||||
var blockListDoc = xmlbuilder.create();
|
||||
blockListDoc = blockListDoc.begin(Constants.BLOCK_LIST_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
var blockListDoc = xmlbuilder.create(Constants.BLOCK_LIST_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
|
||||
if (blockListJs.LatestBlocks) {
|
||||
blockListJs.LatestBlocks.forEach(function (block) {
|
||||
|
|
|
@ -36,8 +36,7 @@ function ContainerAclResult(signedIdentifiers) {
|
|||
* @return {string} The XML container acl permissions.
|
||||
*/
|
||||
ContainerAclResult.serialize = function (signedIdentifiersJs) {
|
||||
var doc = xmlbuilder.create();
|
||||
doc = doc.begin(Constants.SIGNED_IDENTIFIERS_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
var doc = xmlbuilder.create(Constants.SIGNED_IDENTIFIERS_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
|
||||
if (Array.isArray(signedIdentifiersJs) && signedIdentifiersJs.length > 0) {
|
||||
signedIdentifiersJs.forEach(function (signedIdentifier) {
|
||||
|
|
|
@ -22,8 +22,7 @@ var Constants = azureCommon.Constants;
|
|||
exports = module.exports;
|
||||
|
||||
exports.serialize = function (servicePropertiesJs) {
|
||||
var doc = xmlbuilder.create();
|
||||
doc = doc.begin(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
var doc = xmlbuilder.create(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
|
||||
if (typeof servicePropertiesJs.Logging !== 'undefined') {
|
||||
doc = doc.ele(Constants.LOGGING_ELEMENT);
|
||||
|
|
|
@ -46,8 +46,7 @@ function QueueMessageResult(queue, messageid, popreceipt, metadata) {
|
|||
* @return {string} The XML queue message.
|
||||
*/
|
||||
QueueMessageResult.serialize = function (messageJs) {
|
||||
var doc = xmlbuilder.create();
|
||||
doc = doc.begin(Constants.QUEUE_MESSAGE_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
var doc = xmlbuilder.create(Constants.QUEUE_MESSAGE_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
|
||||
if (messageJs) {
|
||||
doc.ele(Constants.MESSAGE_TEXT_ELEMENT)
|
||||
|
|
|
@ -22,8 +22,7 @@ var Constants = azureCommon.Constants;
|
|||
exports = module.exports;
|
||||
|
||||
exports.serialize = function (servicePropertiesJs) {
|
||||
var doc = xmlbuilder.create();
|
||||
doc = doc.begin(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
var doc = xmlbuilder.create(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
|
||||
if (typeof servicePropertiesJs.Logging !== 'undefined') {
|
||||
doc = doc.ele(Constants.LOGGING_ELEMENT);
|
||||
|
|
|
@ -23,8 +23,7 @@ var Constants = azureCommon.Constants;
|
|||
var exports = module.exports;
|
||||
|
||||
exports.serialize = function (servicePropertiesJs) {
|
||||
var doc = xmlbuilder.create();
|
||||
doc = doc.begin(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
var doc = xmlbuilder.create(Constants.STORAGE_SERVICE_PROPERTIES_ELEMENT, { version: '1.0', encoding: 'utf-8' });
|
||||
|
||||
if (typeof servicePropertiesJs.Logging !== 'undefined') {
|
||||
doc = doc.ele(Constants.LOGGING_ELEMENT);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
"Rodrigues, Andre <andrerod@microsoft.com>",
|
||||
"Tavares, Chris <ctavares@microsoft.com>"
|
||||
],
|
||||
"version": "0.11.1",
|
||||
"version": "0.11.2",
|
||||
"description": "Microsoft Azure Storage Client Library for node for back compat with older versions of node sdk",
|
||||
"tags": [
|
||||
"azure",
|
||||
|
|
Загрузка…
Ссылка в новой задаче