Skip to content
Open
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
6 changes: 4 additions & 2 deletions modules/dasBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,14 +335,16 @@ 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 {
method: 'POST',
url: baseUrl,
data: jsonData,
options: {
withCredentials: true,
withCredentials,
crossOrigin: true,
customHeaders: {
'Content-Type': 'text/plain'
Expand All @@ -355,7 +357,7 @@ export const spec = {
method: 'GET',
url: fullUrl,
options: {
withCredentials: true,
withCredentials,
crossOrigin: true,
},
};
Expand Down
28 changes: 28 additions & 0 deletions test/spec/modules/dasBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Loading