Skip to content

Commit

Permalink
add parameter to the conversant adapter to override the url (#5133)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwier authored Apr 17, 2020
1 parent 2efa352 commit 8a681b7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/conversantBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const spec = {
let requestId = '';
let pubcid = null;
let pubcidName = '_pubcid';
let bidurl = URL;

const conversantImps = validBidRequests.map(function(bid) {
const bidfloor = utils.getBidIdParameter('bidfloor', bid.params);
Expand Down Expand Up @@ -109,6 +110,9 @@ export const spec = {
} else if (bid.crumbs && bid.crumbs.pubcid) {
pubcid = bid.crumbs.pubcid;
}
if (bid.params.white_label_url) {
bidurl = bid.params.white_label_url;
}

return imp;
});
Expand Down Expand Up @@ -164,7 +168,7 @@ export const spec = {

return {
method: 'POST',
url: URL,
url: bidurl,
data: payload,
};
},
Expand Down
1 change: 1 addition & 0 deletions modules/conversantBidAdapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var adUnits = [
site_id: '108060',
api: [2],
protocols: [1, 2],
white_label_url: 'https://web.hb.ad.cpe.dotomi.com/s2s/header/24',
mimes: ['video/mp4']
}
}]
Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/conversantBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,12 @@ describe('Conversant adapter tests', function() {
expect(payload).to.not.have.property('user'); // there should be no user by default
});

it('Verify override url', function() {
const testUrl = 'https://someurl?name=value';
const request = spec.buildRequests([{params: {white_label_url: testUrl}}]);
expect(request.url).to.equal(testUrl);
});

it('Verify interpretResponse', function() {
const request = spec.buildRequests(bidRequests);
const response = spec.interpretResponse(bidResponses, request);
Expand Down

0 comments on commit 8a681b7

Please sign in to comment.