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 and umakajan committed May 6, 2021
1 parent 9c7deef commit 798ed85
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 798ed85

Please sign in to comment.