Skip to content

Commit

Permalink
XDomainRequest.send exception fix (#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckbo3hrk authored and Matt Kendall committed Dec 11, 2017
1 parent 8292bb1 commit fdad392
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ export function ajaxBuilder(timeout = 3000) {
}
x.setRequestHeader('Content-Type', options.contentType || 'text/plain');
}
x.send(method === 'POST' && data);
if (method === 'POST' && data) {
x.send(data);
} else {
x.send();
}
} catch (error) {
utils.logError('xhr construction', error);
}
Expand Down

0 comments on commit fdad392

Please sign in to comment.