diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index 75e1af23c8a..f309e4b7cac 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -237,7 +237,7 @@ export const spec = { } if (config.getConfig('coppa') === true) { - utils.deepSetValue(request, 'regs.coppa', 1); + utils.deepSetValue(data, 'regs.coppa', 1); } return { diff --git a/test/spec/modules/rubiconBidAdapter_spec.js b/test/spec/modules/rubiconBidAdapter_spec.js index 988b518f348..f7432435060 100644 --- a/test/spec/modules/rubiconBidAdapter_spec.js +++ b/test/spec/modules/rubiconBidAdapter_spec.js @@ -1356,6 +1356,24 @@ describe('the rubicon adapter', function () { expect(requests.length).to.equal(1); expect(requests[0].url).to.equal(FASTLANE_ENDPOINT); }); + + it('should include coppa flag in video bid request', () => { + createVideoBidderRequest(); + + sandbox.stub(Date, 'now').callsFake(() => + bidderRequest.auctionStart + 100 + ); + + sandbox.stub(config, 'getConfig').callsFake(key => { + const config = { + 'coppa': true + }; + return config[key]; + }); + + const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest); + expect(request.data.regs.coppa).to.equal(1); + }); }); describe('combineSlotUrlParams', function () {