From 5cce121ed2d53008712015a0ed883f467635db08 Mon Sep 17 00:00:00 2001 From: dpiwko Date: Tue, 14 Jul 2026 16:05:26 +0200 Subject: [PATCH 1/2] adshield --- modules/dasBidAdapter.js | 10 ++++++++++ modules/ringieraxelspringerBidAdapter.js | 6 +++++- test/spec/modules/dasBidAdapter_spec.js | 24 ++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/dasBidAdapter.js b/modules/dasBidAdapter.js index 557ebaceed8..d4e2f92ccfe 100644 --- a/modules/dasBidAdapter.js +++ b/modules/dasBidAdapter.js @@ -147,6 +147,12 @@ function parseParams(params, bidderRequest) { customParams.dsainfo = dsaRequired; } + // AdShield anti-adblock recovery signal (set by dlApi as customParams.asd, like adbeta). + // Routed into ext.keyvalues so das-bidder serves only adblock_compability == 2 demand. + if (customParams.asd !== undefined) { + keyValues.asd = customParams.asd; + } + return { customParams, keyValues, @@ -357,6 +363,10 @@ export const spec = { const baseUrl = getEndpoint(data.ext.network); const fullUrl = `${baseUrl}?data=${encodeURIComponent(jsonData)}`; + const queryParams = Object.fromEntries(new URL(fullUrl).searchParams.entries()); + // eslint-disable-next-line no-console + console.log('[das] CSR request:', { url: baseUrl, fullUrl, data: jsonData, queryParams }); + // adbeta needs credentials omitted to avoid CORS issues, especially in Firefox const useCredentials = !data.ext?.adbeta; diff --git a/modules/ringieraxelspringerBidAdapter.js b/modules/ringieraxelspringerBidAdapter.js index a76fd7a1bec..1b0400d596a 100644 --- a/modules/ringieraxelspringerBidAdapter.js +++ b/modules/ringieraxelspringerBidAdapter.js @@ -374,9 +374,13 @@ export const spec = { mediaType: (bid.mediaTypes && bid.mediaTypes.banner) ? 'display' : NATIVE })); + const url = getEndpoint(network) + contextQuery + slotsQuery + gdprQuery; + // eslint-disable-next-line no-console + console.log('[ringieraxelspringer] CSR request:', url); + return [{ method: 'GET', - url: getEndpoint(network) + contextQuery + slotsQuery + gdprQuery, + url, bidIds: bidIds }]; }, diff --git a/test/spec/modules/dasBidAdapter_spec.js b/test/spec/modules/dasBidAdapter_spec.js index 271a1afb9f0..078baf8c6cb 100644 --- a/test/spec/modules/dasBidAdapter_spec.js +++ b/test/spec/modules/dasBidAdapter_spec.js @@ -179,6 +179,30 @@ describe('dasBidAdapter', function () { expect(payload.imp[0].banner.format[0]).to.deep.equal({ w: 300, h: 250 }); }); + it('should route customParams.asd into ext.keyvalues 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.keyvalues.asd).to.equal(1); + }); + + it('should not set ext.keyvalues.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.keyvalues.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'); From 35f4b445073739c28aaa8acc820426caf9ff05ec Mon Sep 17 00:00:00 2001 From: dpiwko Date: Wed, 15 Jul 2026 12:13:22 +0200 Subject: [PATCH 2/2] adshield --- modules/dasBidAdapter.js | 17 +++++++---------- modules/ringieraxelspringerBidAdapter.js | 6 +----- test/spec/modules/dasBidAdapter_spec.js | 9 +++++---- 3 files changed, 13 insertions(+), 19 deletions(-) diff --git a/modules/dasBidAdapter.js b/modules/dasBidAdapter.js index d4e2f92ccfe..1327ec9f1e4 100644 --- a/modules/dasBidAdapter.js +++ b/modules/dasBidAdapter.js @@ -147,12 +147,6 @@ function parseParams(params, bidderRequest) { customParams.dsainfo = dsaRequired; } - // AdShield anti-adblock recovery signal (set by dlApi as customParams.asd, like adbeta). - // Routed into ext.keyvalues so das-bidder serves only adblock_compability == 2 demand. - if (customParams.asd !== undefined) { - keyValues.asd = customParams.asd; - } - return { customParams, keyValues, @@ -254,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; } @@ -363,10 +364,6 @@ export const spec = { const baseUrl = getEndpoint(data.ext.network); const fullUrl = `${baseUrl}?data=${encodeURIComponent(jsonData)}`; - const queryParams = Object.fromEntries(new URL(fullUrl).searchParams.entries()); - // eslint-disable-next-line no-console - console.log('[das] CSR request:', { url: baseUrl, fullUrl, data: jsonData, queryParams }); - // adbeta needs credentials omitted to avoid CORS issues, especially in Firefox const useCredentials = !data.ext?.adbeta; diff --git a/modules/ringieraxelspringerBidAdapter.js b/modules/ringieraxelspringerBidAdapter.js index 1b0400d596a..a76fd7a1bec 100644 --- a/modules/ringieraxelspringerBidAdapter.js +++ b/modules/ringieraxelspringerBidAdapter.js @@ -374,13 +374,9 @@ export const spec = { mediaType: (bid.mediaTypes && bid.mediaTypes.banner) ? 'display' : NATIVE })); - const url = getEndpoint(network) + contextQuery + slotsQuery + gdprQuery; - // eslint-disable-next-line no-console - console.log('[ringieraxelspringer] CSR request:', url); - return [{ method: 'GET', - url, + url: getEndpoint(network) + contextQuery + slotsQuery + gdprQuery, bidIds: bidIds }]; }, diff --git a/test/spec/modules/dasBidAdapter_spec.js b/test/spec/modules/dasBidAdapter_spec.js index 078baf8c6cb..d8252171945 100644 --- a/test/spec/modules/dasBidAdapter_spec.js +++ b/test/spec/modules/dasBidAdapter_spec.js @@ -179,7 +179,7 @@ describe('dasBidAdapter', function () { expect(payload.imp[0].banner.format[0]).to.deep.equal({ w: 300, h: 250 }); }); - it('should route customParams.asd into ext.keyvalues for AdShield recovery', function () { + it('should route customParams.asd into ext.asd for AdShield recovery', function () { const asdBidRequests = [{ ...bidRequests[0], params: { @@ -192,15 +192,16 @@ describe('dasBidAdapter', function () { const params = new URLSearchParams(request.url.split('?')[1]); const payload = JSON.parse(decodeURIComponent(params.get('data'))); - expect(payload.ext.keyvalues.asd).to.equal(1); + expect(payload.ext.asd).to.equal(1); + expect(payload.ext.keyvalues.asd).to.be.undefined; }); - it('should not set ext.keyvalues.asd without customParams.asd', function () { + 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.keyvalues.asd).to.be.undefined; + expect(payload.ext.asd).to.be.undefined; }); it('should use GET method when URL is under 8192 characters', function () {