Skip to content

Commit

Permalink
support for cookie deprecation label (prebid#10695)
Browse files Browse the repository at this point in the history
  • Loading branch information
jlquaccia authored Nov 4, 2023
1 parent b4598fa commit a069331
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/pubmaticBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1232,6 +1232,10 @@ export const spec = {
payload.device.sua = device?.sua;
}

if (device?.ext?.cdep) {
deepSetValue(payload, 'device.ext.cdep', device.ext.cdep);
}

if (user?.geo && device?.geo) {
payload.device.geo = { ...payload.device.geo, ...device.geo };
payload.user.geo = { ...payload.user.geo, ...user.geo };
Expand Down
17 changes: 17 additions & 0 deletions test/spec/modules/pubmaticBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,23 @@ describe('PubMatic adapter', function () {
expect(data.device.sua).to.deep.equal(suaObject);
});

it('should pass device.ext.cdep if present in bidderRequest fpd ortb2 object', function () {
const cdepObj = {
cdep: 'example_label_1'
};
let request = spec.buildRequests(multipleMediaRequests, {
auctionId: 'new-auction-id',
ortb2: {
device: {
ext: cdepObj
}
}
});
let data = JSON.parse(request.data);
expect(data.device.ext.cdep).to.exist.and.to.be.an('string');
expect(data.device.ext).to.deep.equal(cdepObj);
});

it('Request params should have valid native bid request for all valid params', function () {
let request = spec.buildRequests(nativeBidRequests, {
auctionId: 'new-auction-id'
Expand Down

0 comments on commit a069331

Please sign in to comment.