diff --git a/modules/oneVideoBidAdapter.js b/modules/oneVideoBidAdapter.js index 99d976e9efe..6243bf0497e 100644 --- a/modules/oneVideoBidAdapter.js +++ b/modules/oneVideoBidAdapter.js @@ -3,7 +3,7 @@ import {registerBidder} from '../src/adapters/bidderFactory'; const BIDDER_CODE = 'oneVideo'; export const spec = { code: 'oneVideo', - ENDPOINT: '//ads.adaptv.advertising.com/rtb/openrtb?ext_id=', + ENDPOINT: 'https://ads.adaptv.advertising.com/rtb/openrtb?ext_id=', SYNC_ENDPOINT1: 'https://cm.g.doubleclick.net/pixel?google_nid=adaptv_dbm&google_cm&google_sc', SYNC_ENDPOINT2: 'https://pr-bh.ybp.yahoo.com/sync/adaptv_ortb/{combo_uid}', SYNC_ENDPOINT3: 'https://sync-tm.everesttech.net/upi/pid/m7y5t93k?redir=https%3A%2F%2Fsync.adap.tv%2Fsync%3Ftype%3Dgif%26key%3Dtubemogul%26uid%3D%24%7BUSER_ID%7D', @@ -45,7 +45,9 @@ export const spec = { return bids.map(bid => { return { method: 'POST', - url: location.protocol + spec.ENDPOINT + bid.params.pubId, + /** removing adding local protocal since we + * can get cookie data only if we call with https. */ + url: spec.ENDPOINT + bid.params.pubId, data: getRequestData(bid, consentData), bidRequest: bid } @@ -193,28 +195,12 @@ function getRequestData(bid, consentData) { if (bid.params.video.placement) { bidData.imp[0].video.placement = bid.params.video.placement } - if (bid.params.video.inventoryid) { - bidData.imp[0].ext.inventoryid = bid.params.video.inventoryid - } if (bid.params.video.rewarded) { bidData.imp[0].ext.rewarded = bid.params.video.rewarded } if (bid.params.site && bid.params.site.id) { bidData.site.id = bid.params.site.id } - if (bid.params.video.sid) { - bidData.source = { - ext: { - schain: { - complete: 1, - nodes: [{ - sid: bid.params.video.sid, - rid: bidData.id, - }] - } - } - } - } } else if (bid.params.video.display == 1) { bidData.imp[0].banner = { mimes: bid.params.video.mimes, @@ -223,6 +209,22 @@ function getRequestData(bid, consentData) { pos: bid.params.video.position, }; } + if (bid.params.video.inventoryid) { + bidData.imp[0].ext.inventoryid = bid.params.video.inventoryid + } + if (bid.params.video.sid) { + bidData.source = { + ext: { + schain: { + complete: 1, + nodes: [{ + sid: bid.params.video.sid, + rid: bidData.id, + }] + } + } + } + } if (isConsentRequired(consentData)) { bidData.regs = { ext: { diff --git a/test/spec/modules/oneVideoBidAdapter_spec.js b/test/spec/modules/oneVideoBidAdapter_spec.js index 1de413ae596..eccfda0cef7 100644 --- a/test/spec/modules/oneVideoBidAdapter_spec.js +++ b/test/spec/modules/oneVideoBidAdapter_spec.js @@ -107,7 +107,7 @@ describe('OneVideoBidAdapter', function () { it('should create a POST request for every bid', function () { const requests = spec.buildRequests([ bidRequest ]); expect(requests[0].method).to.equal('POST'); - expect(requests[0].url).to.equal(location.protocol + spec.ENDPOINT + bidRequest.params.pubId); + expect(requests[0].url).to.equal(spec.ENDPOINT + bidRequest.params.pubId); }); it('should attach the bid request object', function () { @@ -240,7 +240,8 @@ describe('OneVideoBidAdapter', function () { position: 1, delivery: [2], playbackmethod: [1, 5], - placement: 123, + placement: 1, + inventoryid: 123, sid: 134, display: 1 }, @@ -261,6 +262,7 @@ describe('OneVideoBidAdapter', function () { expect(data.imp[0].banner.w).to.equal(width); expect(data.imp[0].banner.h).to.equal(height); expect(data.imp[0].banner.pos).to.equal(position); + expect(data.imp[0].ext.inventoryid).to.equal(bidRequest.params.video.inventoryid); expect(data.imp[0].banner.mimes).to.equal(bidRequest.params.video.mimes); }); it('should send video object when display is other than 1', function () {