Skip to content

Commit

Permalink
Fix an error when using URLSearchParams with fetch (#680)
Browse files Browse the repository at this point in the history
Fix an error when using URLSearchParams with fetch
  • Loading branch information
zloirock committed Oct 29, 2019
2 parents e3f4c9e + 763b979 commit fa5dc92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core-js/modules/web.url-search-params.js
Expand Up @@ -325,7 +325,7 @@ if (!USE_NATIVE_URL && typeof $fetch == 'function' && typeof Headers == 'functio
if (isObject(init)) {
body = init.body;
if (classof(body) === URL_SEARCH_PARAMS) {
headers = new Headers(init.headers);
headers = init.headers ? new Headers(init.headers) : new Headers();
if (!headers.has('content-type')) {
headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
}
Expand Down

0 comments on commit fa5dc92

Please sign in to comment.