Skip to content

Commit

Permalink
XDomainRequest.send exception fix (prebid#1942)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckbo3hrk authored and Justas Pupelis committed Jan 10, 2018
1 parent 2879bd4 commit bdc19fd
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 bdc19fd

Please sign in to comment.