Skip to content

Commit

Permalink
fix(http-client): work around bug in IE/Edge where Blob types are ign…
Browse files Browse the repository at this point in the history
…ored
  • Loading branch information
bryanrsmith committed Dec 17, 2015
1 parent 25d5985 commit 36407e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/http-client.js
Expand Up @@ -170,6 +170,12 @@ function buildRequest(input, init = {}) {
let request = new Request((this.baseUrl || '') + url, requestInit);
setDefaultHeaders(request.headers, parsedDefaultHeaders);

if (body && Blob.prototype.isPrototypeOf(body) && body.type) {
// work around bug in IE & Edge where the Blob type is ignored in the request
// https://connect.microsoft.com/IE/feedback/details/2136163
request.headers.set('Content-Type', body.type);
}

return request;
}

Expand Down

0 comments on commit 36407e2

Please sign in to comment.