Skip to content

Commit

Permalink
Rubicon Bid Adapter: Do not send storedrequests (prebid#8717)
Browse files Browse the repository at this point in the history
* do NOT send stored requests!

* set to undefined not delete faster?
  • Loading branch information
robertrmartinez authored and JacobKlein26 committed Feb 8, 2023
1 parent c145f09 commit 2489ec0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ export const spec = {
// set ext.prebid.auctiontimestamp using auction time
deepSetValue(data.imp[0], 'ext.prebid.auctiontimestamp', bidderRequest.auctionStart);

// set storedrequests to undefined so not sent to PBS
// top level and imp level both 'ext.prebid' objects are set above so no exception thrown here
data.ext.prebid.storedrequest = undefined;
data.imp[0].ext.prebid.storedrequest = undefined;

return {
method: 'POST',
url: `https://${rubiConf.videoHost || 'prebid-server'}.rubiconproject.com/openrtb2/auction`,
Expand Down
27 changes: 27 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2139,6 +2139,33 @@ describe('the rubicon adapter', function () {
expect(request.data.imp[0].ext.data.pbadslot).to.equal('1234567890');
});

it('should NOT include storedrequests in pbs payload', function () {
createVideoBidderRequest();
bidderRequest.bids[0].ortb2 = {
ext: {
prebid: {
storedrequest: 'no-send-top-level-sr'
}
}
}

bidderRequest.bids[0].ortb2Imp = {
ext: {
prebid: {
storedrequest: 'no-send-imp-sr'
}
}
}

sandbox.stub(Date, 'now').callsFake(() =>
bidderRequest.auctionStart + 100
);

const [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
expect(request.data.ext.prebid.storedrequest).to.be.undefined;
expect(request.data.imp[0].ext.prebid.storedrequest).to.be.undefined;
});

it('should include GAM ad unit in bid request', function () {
createVideoBidderRequest();
bidderRequest.bids[0].ortb2Imp = {
Expand Down

0 comments on commit 2489ec0

Please sign in to comment.