Skip to content

Commit

Permalink
Conversant Bid Adapter handles vast xml (prebid#4492)
Browse files Browse the repository at this point in the history
  • Loading branch information
pycnvr authored and afewcc committed Dec 10, 2019
1 parent 9c91b3a commit 051d9d5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
7 changes: 6 additions & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,12 @@ export const spec = {
};

if (request.video) {
bid.vastUrl = responseAd;
if (responseAd.charAt(0) === '<') {
bid.vastXml = responseAd;
} else {
bid.vastUrl = responseAd;
}

bid.mediaType = 'video';
bid.width = request.video.w;
bid.height = request.video.h;
Expand Down
13 changes: 12 additions & 1 deletion test/spec/modules/conversantBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ describe('Conversant adapter tests', function() {
price: 3.99,
adomain: ['https://example.com'],
id: 'bid003'
}, {
nurl: 'notify004',
adm: '<?xml><VAST></VAST>',
crid: '1004',
impid: 'bid004',
price: 4.99,
adomain: ['https://example.com'],
id: 'bid004'
}]
}]
},
Expand Down Expand Up @@ -315,7 +323,7 @@ describe('Conversant adapter tests', function() {
it('Verify interpretResponse', function() {
const request = spec.buildRequests(bidRequests);
const response = spec.interpretResponse(bidResponses, request);
expect(response).to.be.an('array').with.lengthOf(3);
expect(response).to.be.an('array').with.lengthOf(4);

let bid = response[0];
expect(bid).to.have.property('requestId', 'bid000');
Expand Down Expand Up @@ -352,6 +360,9 @@ describe('Conversant adapter tests', function() {
expect(bid).to.have.property('mediaType', 'video');
expect(bid).to.have.property('ttl', 300);
expect(bid).to.have.property('netRevenue', true);

bid = response[3];
expect(bid).to.have.property('vastXml', '<?xml><VAST></VAST>');
});

it('Verify handling of bad responses', function() {
Expand Down

0 comments on commit 051d9d5

Please sign in to comment.