Skip to content
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
7 changes: 7 additions & 0 deletions modules/dasBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,13 @@ function buildOpenRTBRequest(bidRequests, bidderRequest) {
request.ext.adbeta = customParams.adbeta;
}

// AdShield anti-adblock recovery signal (set by dlApi as customParams.asd, like adbeta).
// Sent as a plain ext field (not a key-value) so das-bidder serves only
// adblock-compatible demand (adblock_compability == 2).
if (customParams.asd) {
request.ext.asd = customParams.asd;
}

if (bidderRequest.device) {
request.device = bidderRequest.device;
}
Expand Down
25 changes: 25 additions & 0 deletions test/spec/modules/dasBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,31 @@ describe('dasBidAdapter', function () {
expect(payload.imp[0].banner.format[0]).to.deep.equal({ w: 300, h: 250 });
});

it('should route customParams.asd into ext.asd for AdShield recovery', function () {
const asdBidRequests = [{
...bidRequests[0],
params: {
...bidRequests[0].params,
customParams: { asd: 1 }
}
}];

const request = spec.buildRequests(asdBidRequests, bidderRequest);
const params = new URLSearchParams(request.url.split('?')[1]);
const payload = JSON.parse(decodeURIComponent(params.get('data')));

expect(payload.ext.asd).to.equal(1);
expect(payload.ext.keyvalues.asd).to.be.undefined;
});

it('should not set ext.asd without customParams.asd', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
const params = new URLSearchParams(request.url.split('?')[1]);
const payload = JSON.parse(decodeURIComponent(params.get('data')));

expect(payload.ext.asd).to.be.undefined;
});

it('should use GET method when URL is under 8192 characters', function () {
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.method).to.equal('GET');
Expand Down
Loading