Skip to content

Commit

Permalink
fixing line endings in a batch request
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrRogov committed Feb 20, 2025
1 parent 9cf728d commit 9d83cf8
Show file tree
Hide file tree
Showing 13 changed files with 1,835 additions and 1,653 deletions.
21 changes: 11 additions & 10 deletions dist/browser/esm/dynamics-web-api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions dist/cjs/dynamics-web-api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions dist/dynamics-web-api.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions dist/esm/dynamics-web-api.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1185,21 +1185,21 @@ var convertToBatch = (requests, config, batchRequest) => {
if ((batchRequest == null ? void 0 : batchRequest.inChangeSet) === false) internalRequest.inChangeSet = false;
const inChangeSet = internalRequest.method === "GET" ? false : !!internalRequest.inChangeSet;
if (!inChangeSet && currentChangeSet) {
batchBody.push(`
batchBody.push(`\r
--${currentChangeSet}--`);
currentChangeSet = null;
contentId = 1e5;
}
if (!currentChangeSet) {
batchBody.push(`
batchBody.push(`\r
--${batchBoundary}`);
if (inChangeSet) {
currentChangeSet = `changeset_${generateUUID()}`;
batchBody.push("Content-Type: multipart/mixed;boundary=" + currentChangeSet);
}
}
if (inChangeSet) {
batchBody.push(`
batchBody.push(`\r
--${currentChangeSet}`);
}
batchBody.push("Content-Type: application/http");
Expand All @@ -1209,10 +1209,10 @@ var convertToBatch = (requests, config, batchRequest) => {
batchBody.push(`Content-ID: ${contentIdValue}`);
}
if (!((_a2 = internalRequest.path) == null ? void 0 : _a2.startsWith("$"))) {
batchBody.push(`
batchBody.push(`\r
${internalRequest.method} ${config.dataApi.url}${internalRequest.path} HTTP/1.1`);
} else {
batchBody.push(`
batchBody.push(`\r
${internalRequest.method} ${internalRequest.path} HTTP/1.1`);
}
if (internalRequest.method === "GET") {
Expand All @@ -1224,19 +1224,20 @@ ${internalRequest.method} ${internalRequest.path} HTTP/1.1`);
addHeaders(internalRequest.headers, batchBody);
}
if (internalRequest.data) {
batchBody.push(`
batchBody.push(`\r
${processData(internalRequest.data, config)}`);
}
});
if (currentChangeSet) {
batchBody.push(`
batchBody.push(`\r
--${currentChangeSet}--`);
}
batchBody.push(`
--${batchBoundary}--`);
batchBody.push(`\r
--${batchBoundary}--\r
`);
const headers = setStandardHeaders(batchRequest == null ? void 0 : batchRequest.userHeaders);
headers["Content-Type"] = `multipart/mixed;boundary=${batchBoundary}`;
return { headers, body: batchBody.join("\n") };
return { headers, body: batchBody.join("\r\n") };
};
var findCollectionName = (entityName) => {
if (isNull(entityNames)) return null;
Expand Down
Loading

0 comments on commit 9d83cf8

Please sign in to comment.