Skip to content

Commit

Permalink
add X-Prebid header to ajax requests fixes prebid#6627 (prebid#6676)
Browse files Browse the repository at this point in the history
  • Loading branch information
snapwich authored May 3, 2021
1 parent 2e7209a commit a887289
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ export function ajaxBuilder(timeout = 3000, {request, done} = {}) {
if (options.withCredentials) {
x.withCredentials = true;
}
x.setRequestHeader('x-prebid', 'pbjs/$prebid.version$');
utils._each(options.customHeaders, (value, header) => {
x.setRequestHeader(header, value);
});
if (options.preflight) {
x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
x.setRequestHeader('x-requested-with', 'XMLHttpRequest');
}
x.setRequestHeader('Content-Type', options.contentType || 'text/plain');

Expand Down

0 comments on commit a887289

Please sign in to comment.