From 8a681b7ef1649af4b22677b1ee7aa576cfc2048c Mon Sep 17 00:00:00 2001 From: johnwier <49074029+johnwier@users.noreply.github.com> Date: Fri, 17 Apr 2020 09:21:02 -0700 Subject: [PATCH] add parameter to the conversant adapter to override the url (#5133) --- modules/conversantBidAdapter.js | 6 +++++- modules/conversantBidAdapter.md | 1 + test/spec/modules/conversantBidAdapter_spec.js | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/conversantBidAdapter.js b/modules/conversantBidAdapter.js index 25eed9c0e99..2ecdb2b7e98 100644 --- a/modules/conversantBidAdapter.js +++ b/modules/conversantBidAdapter.js @@ -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); @@ -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; }); @@ -164,7 +168,7 @@ export const spec = { return { method: 'POST', - url: URL, + url: bidurl, data: payload, }; }, diff --git a/modules/conversantBidAdapter.md b/modules/conversantBidAdapter.md index 5aba5653043..fba793adad2 100644 --- a/modules/conversantBidAdapter.md +++ b/modules/conversantBidAdapter.md @@ -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'] } }] diff --git a/test/spec/modules/conversantBidAdapter_spec.js b/test/spec/modules/conversantBidAdapter_spec.js index 28075628d5a..7c6d6e5dd6c 100644 --- a/test/spec/modules/conversantBidAdapter_spec.js +++ b/test/spec/modules/conversantBidAdapter_spec.js @@ -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);