Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appnexus bid adapter: ensure withCredentials is always passed #6675

Merged
merged 1 commit into from
Apr 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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