Skip to content

Commit

Permalink
appnexus bid adapter - ensure withCredentials is always passed (prebi…
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnellbaker authored and umakajan committed May 6, 2021
1 parent 33b6005 commit d39b1ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion modules/appnexusBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,10 @@ function hasPurpose1Consent(bidderRequest) {

function formatRequest(payload, bidderRequest) {
let request = [];
let options = {};
let options = {
withCredentials: true
};

let endpointUrl = URL;

if (!hasPurpose1Consent(bidderRequest)) {
Expand Down
8 changes: 7 additions & 1 deletion test/spec/modules/appnexusBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ describe('AppNexusAdapter', function () {
bidderRequest.bids = bidRequests;

const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.options).to.be.empty;
expect(request.options).to.deep.equal({withCredentials: true});
const payload = JSON.parse(request.data);

expect(payload.gdpr_consent).to.exist;
Expand Down Expand Up @@ -796,6 +796,12 @@ describe('AppNexusAdapter', function () {
config.getConfig.restore();
});

it('should always set withCredentials: true on the request.options', function () {
let bidRequest = Object.assign({}, bidRequests[0]);
const request = spec.buildRequests([bidRequest]);
expect(request.options.withCredentials).to.equal(true);
});

it('should set simple domain variant if purpose 1 consent is not given', function () {
let consentString = 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A==';
let bidderRequest = {
Expand Down

0 comments on commit d39b1ee

Please sign in to comment.