Skip to content

Commit 73177f0

Browse files
authored
Merge pull request #213 from microsoftgraph/abhsriva/BatchResponseContent
Made changes so that batching works for json response
2 parents 00800e7 + 4619f25 commit 73177f0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/content/BatchResponseContent.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ export class BatchResponseContent {
6969
options.statusText = responseJSON.statusText;
7070
}
7171
options.headers = responseJSON.headers;
72+
if (options.headers !== undefined && options.headers["Content-Type"] !== undefined) {
73+
if (options.headers["Content-Type"].split(";")[0] === "application/json") {
74+
const bodyString = JSON.stringify(body);
75+
return new Response(bodyString, options);
76+
}
77+
}
7278
return new Response(body, options);
7379
}
7480

0 commit comments

Comments
 (0)