diff --git a/modules/dasBidAdapter.js b/modules/dasBidAdapter.js index 31f726ac2ae..3cab37fcad9 100644 --- a/modules/dasBidAdapter.js +++ b/modules/dasBidAdapter.js @@ -335,6 +335,8 @@ export const spec = { const baseUrl = getEndpoint(data.ext.network); const fullUrl = `${baseUrl}?data=${encodeURIComponent(jsonData)}`; + const withCredentials = data?.ext?.adbeta ? false : true; + // Switch to POST if URL exceeds 8k characters if (fullUrl.length > 8192) { return { @@ -342,7 +344,7 @@ export const spec = { url: baseUrl, data: jsonData, options: { - withCredentials: true, + withCredentials, crossOrigin: true, customHeaders: { 'Content-Type': 'text/plain' @@ -355,7 +357,7 @@ export const spec = { method: 'GET', url: fullUrl, options: { - withCredentials: true, + withCredentials, crossOrigin: true, }, }; diff --git a/test/spec/modules/dasBidAdapter_spec.js b/test/spec/modules/dasBidAdapter_spec.js index 07b86210c74..69114fe32ba 100644 --- a/test/spec/modules/dasBidAdapter_spec.js +++ b/test/spec/modules/dasBidAdapter_spec.js @@ -265,6 +265,34 @@ describe('dasBidAdapter', function () { expect(payload.ext.network).to.equal('network1'); }); + it('should set withCredentials to false when adbeta flag is present', function () { + const bidRequestsWithAdbeta = [{ + bidId: 'bid123', + params: { + site: 'site1', + area: 'area1', + slot: 'slot1', + network: 'network1', + pageContext: {} + }, + mediaTypes: { + banner: { + sizes: [[300, 250]] + } + } + }]; + + const bidderRequestWithAdbeta = { + bidderRequestId: 'reqId123', + ortb2: {}, + adbeta: true + }; + + const request = spec.buildRequests(bidRequestsWithAdbeta, bidderRequestWithAdbeta); + + expect(request.options.withCredentials).to.be.false; + }); + describe('interpretResponse', function () { const serverResponse = { body: {