Merge pull request #935 from andrerod/dev

Fix property ordering
This commit is contained in:
André Rodrigues 2013-08-02 09:00:30 -07:00
Родитель 6f2ddd765d c647ace849
Коммит ee8d8c0375
2 изменённых файлов: 19 добавлений и 5 удалений

Просмотреть файл

@ -185,9 +185,22 @@ ServiceClient.prototype._performRequest = function (webResource, body, options,
finalRequestOptions.body = body.outputData;
}
var buildRequest = function () {
var buildRequest = function (headersOnly) {
// Build request (if body was set before, request will process immediately, if not it'll wait for the piping to happen)
var requestStream = request(finalRequestOptions, processResponseCallback);
var requestStream;
if (headersOnly) {
requestStream = request(finalRequestOptions);
requestStream.on('error', processResponseCallback);
requestStream.on('response', function (response) {
response.on('end', function () {
processResponseCallback(null, response);
});
});
} else {
requestStream = request(finalRequestOptions, processResponseCallback);
}
// Workaround to avoid request from potentially setting unwanted (rejected) headers by the service
var oldEnd = requestStream.end;
requestStream.end = function () {
if (finalRequestOptions.headers['content-length']) {
@ -209,7 +222,7 @@ ServiceClient.prototype._performRequest = function (webResource, body, options,
// Pipe any input / output streams
if (body && body.inputStream) {
buildRequest().pipe(body.inputStream);
buildRequest(true).pipe(body.inputStream);
} else if (body && body.outputStream) {
var sendUnchunked = function () {
var buf = new Buffer(0);

Просмотреть файл

@ -133,10 +133,11 @@ ServiceManagementSerialize.prototype.buildCreateStorageAccount = function (servi
var doc = _createXmlRoot('CreateStorageServiceInput');
_addDefinedValueXml(doc, 'ServiceName', serviceName);
_addDefinedValueXml(doc, 'Label', encLabel);
_addDefinedValueXml(doc, 'Description', serviceOptions.Description);
_addDefinedValueXml(doc, 'Location', serviceOptions.Location);
_addDefinedValueXml(doc, 'Label', encLabel);
_addDefinedValueXml(doc, 'AffinityGroup', serviceOptions.AffinityGroup);
_addDefinedValueXml(doc, 'Location', serviceOptions.Location);
_addDefinedValueXml(doc, 'GeoReplicationEnabled', serviceOptions.GeoReplicationEnabled);
return doc.toString();
};