Skip to content

Commit

Permalink
Merge pull request microsoftgraph#213 from microsoftgraph/abhsriva/Ba…
Browse files Browse the repository at this point in the history
…tchResponseContent

Made changes so that batching works for json response
  • Loading branch information
krototype authored Aug 13, 2019
2 parents 00800e7 + 4619f25 commit 73177f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/content/BatchResponseContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ export class BatchResponseContent {
options.statusText = responseJSON.statusText;
}
options.headers = responseJSON.headers;
if (options.headers !== undefined && options.headers["Content-Type"] !== undefined) {
if (options.headers["Content-Type"].split(";")[0] === "application/json") {
const bodyString = JSON.stringify(body);
return new Response(bodyString, options);
}
}
return new Response(body, options);
}

Expand Down

0 comments on commit 73177f0

Please sign in to comment.