Skip to content

Commit

Permalink
minor code changes for schain implementation (#4870)
Browse files Browse the repository at this point in the history
  • Loading branch information
rajcspsg authored Feb 19, 2020
1 parent 05c19b5 commit d30b0a6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
11 changes: 4 additions & 7 deletions modules/synacormediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ export const spec = {
imp: []
};

if (bidderRequest.bids != undefined && bidderRequest.bids[0] != undefined) {
const schain = bidderRequest.bids[0].schain;
if (schain) {
openRtbBidRequest.source = {};
openRtbBidRequest.source.ext = { schain };
}
const schain = validBidReqs[0].schain;
if (schain) {
openRtbBidRequest.source = { ext: { schain } };
}

let seatId = null;
Expand All @@ -67,7 +64,7 @@ export const spec = {
if (isNaN(bidFloor)) {
logWarn(`Synacormedia: there is an invalid bid floor: ${bid.params.bidfloor}`);
}
let pos = parseInt(bid.params.pos);
let pos = parseInt(bid.params.pos, 10);
if (isNaN(pos)) {
logWarn(`Synacormedia: there is an invalid POS: ${bid.params.pos}`);
pos = 0;
Expand Down
13 changes: 12 additions & 1 deletion test/spec/modules/synacormediaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,18 @@ describe('synacormediaBidAdapter ', function () {
src: 'client',
bidRequestsCount: 1,
bidderRequestsCount: 1,
bidderWinsCount: 0
bidderWinsCount: 0,
schain: {
ver: '1.0',
complete: 1,
nodes: [
{
asi: 'indirectseller.com',
sid: '00001',
hp: 1
}
]
}
};
let bidderRequest = {
refererInfo: {
Expand Down

0 comments on commit d30b0a6

Please sign in to comment.