Skip to content

Commit

Permalink
Fix #10400 (#10401)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrmartinez authored Aug 28, 2023
1 parent cc2b495 commit 1288697
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export const converter = ortbConverter({
if (config.getConfig('s2sConfig.defaultTtl')) {
imp.exp = config.getConfig('s2sConfig.defaultTtl');
};
bidRequest.params.position === 'atf' && (imp.video.pos = 1);
bidRequest.params.position === 'btf' && (imp.video.pos = 3);
bidRequest.params.position === 'atf' && imp.video && (imp.video.pos = 1);
bidRequest.params.position === 'btf' && imp.video && (imp.video.pos = 3);
delete imp.ext?.prebid?.storedrequest;

if (bidRequest.params.bidonmultiformat === true && bidRequestType.length > 1) {
Expand Down
12 changes: 12 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2636,6 +2636,18 @@ describe('the rubicon adapter', function () {
expect(request.data.imp).to.have.nested.property('[0].native');
});

it('should not break if position is set and no video MT', function () {
const bidReq = addNativeToBidRequest(bidderRequest);
delete bidReq.bids[0].mediaTypes.banner;
bidReq.bids[0].params = {
position: 'atf'
}
let [request] = spec.buildRequests(bidReq.bids, bidReq);
expect(request.method).to.equal('POST');
expect(request.url).to.equal('https://prebid-server.rubiconproject.com/openrtb2/auction');
expect(request.data.imp).to.have.nested.property('[0].native');
});

describe('that contains also a banner mediaType', function () {
it('should send the banner to fastlane BUT NOT the native bid because missing params.video', function() {
const bidReq = addNativeToBidRequest(bidderRequest);
Expand Down

0 comments on commit 1288697

Please sign in to comment.