Skip to content

Commit

Permalink
Fix MSIE compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Bakum authored and JakeChampion committed Feb 18, 2021
1 parent 1fce243 commit da97bdb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function Body() {
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')
}
} else if (contentType.includes('json') && typeof this._bodyInit !== 'string') {
} else if (contentType.indexOf('json') >= 0 && typeof this._bodyInit !== 'string') {
// Always pass a text representation of a non-stringified JSON body
// to `XMLHttpRequest.send` to retain a compatible behavior with the browser.
this._bodyInit = this._bodyText
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "whatwg-fetch",
"description": "A window.fetch polyfill.",
"version": "3.6.0",
"version": "3.6.1",
"main": "./dist/fetch.umd.js",
"module": "./fetch.js",
"repository": "github/fetch",
Expand Down

0 comments on commit da97bdb

Please sign in to comment.