Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/services/table/batchserviceclient.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/**
* Copyright 2011 Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down Expand Up @@ -100,10 +100,10 @@ BatchServiceClient.prototype.addOperation = function (webResource, outputData) {
webResource.headers[HeaderConstants.CONTENT_ID] = this.operations.length + 1;

if (webResource.httpVerb !== ServiceClient.HTTP_VERB_DELETE) {
webResource.headers[HeaderConstants.CONTENT_TYPE] = 'application/atom+xml;type=entry';
webResource.headers[HeaderConstants.CONTENT_TYPE] = 'application/atom+xml;charset="utf-8";type=entry';
}

webResource.headers[HeaderConstants.CONTENT_LENGTH] = outputData.length;
webResource.headers[HeaderConstants.CONTENT_LENGTH] = Buffer.byteLength(outputData, 'utf8');
}

this._setRequestUrl(webResource);
Expand Down Expand Up @@ -149,7 +149,7 @@ BatchServiceClient.prototype.commitBatch = function (optionsOrCallback, callback
var changesetBoundary = 'changeset_' + crypto.createHash('md5').update("" + (new Date()).getTime()).digest("hex");

var body = '--' + batchBoundary + '\n';
body += HeaderConstants.CONTENT_TYPE + ': multipart/mixed; boundary=' + changesetBoundary + '\n\n';
body += HeaderConstants.CONTENT_TYPE + ': multipart/mixed;charset="utf-8";boundary=' + changesetBoundary + '\n\n';

for (var operation in this.operations) {
body += '--' + changesetBoundary + '\n';
Expand All @@ -165,10 +165,10 @@ BatchServiceClient.prototype.commitBatch = function (optionsOrCallback, callback
.withOkCode(HttpConstants.HttpResponseCodes.ACCEPTED_CODE)
.withRawResponse(true);

webResource.addOptionalHeader(HeaderConstants.CONTENT_TYPE, 'multipart/mixed; boundary=' + batchBoundary);
webResource.addOptionalHeader(HeaderConstants.CONTENT_TYPE, 'multipart/mixed;charset="utf-8";boundary=' + batchBoundary);
webResource.addOptionalHeader(HeaderConstants.DATA_SERVICE_VERSION, '1.0;NetFx');
webResource.addOptionalHeader(HeaderConstants.MAX_DATA_SERVICE_VERSION, '2.0;NetFx');
webResource.addOptionalHeader(HeaderConstants.CONTENT_LENGTH, body.length);
webResource.addOptionalHeader(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(body, 'utf8'));

var self = this;

Expand Down