Skip to content

Commit

Permalink
removing floor field from bid request when not defined (#8398)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbouallagui authored May 10, 2022
1 parent 04fefef commit 2651c7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions modules/oguryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DEFAULT_TIMEOUT = 1000;
const BID_HOST = 'https://mweb-hb.presage.io/api/header-bidding-request';
const TIMEOUT_MONITORING_HOST = 'https://ms-ads-monitoring-events.presage.io';
const MS_COOKIE_SYNC_DOMAIN = 'https://ms-cookie-sync.presage.io';
const ADAPTER_VERSION = '1.2.10';
const ADAPTER_VERSION = '1.2.11';

function isBidRequestValid(bid) {
const adUnitSizes = getAdUnitSizes(bid);
Expand Down Expand Up @@ -74,11 +74,12 @@ function buildRequests(validBidRequests, bidderRequest) {
if (bidRequest.mediaTypes &&
bidRequest.mediaTypes.hasOwnProperty('banner')) {
openRtbBidRequestBanner.site.id = bidRequest.params.assetKey;
const floor = getFloor(bidRequest);

openRtbBidRequestBanner.imp.push({
id: bidRequest.bidId,
tagid: bidRequest.params.adUnitId,
bidfloor: getFloor(bidRequest),
...(floor && {bidfloor: floor}),
banner: {
format: sizes
},
Expand Down
9 changes: 4 additions & 5 deletions test/spec/modules/oguryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ describe('OguryBidAdapter', function () {
}, {
id: bidRequests[1].bidId,
tagid: bidRequests[1].params.adUnitId,
bidfloor: 0,
banner: {
format: [{
w: 600,
Expand All @@ -271,7 +270,7 @@ describe('OguryBidAdapter', function () {
},
ext: {
prebidversion: '$prebid.version$',
adapterversion: '1.2.10'
adapterversion: '1.2.11'
}
};

Expand Down Expand Up @@ -401,7 +400,7 @@ describe('OguryBidAdapter', function () {

it('should handle bidFloor when currency is not USD', () => {
const expectedRequestWithUnsupportedFloorCurrency = utils.deepClone(expectedRequestObject)
expectedRequestWithUnsupportedFloorCurrency.imp[0].bidfloor = 0;
delete expectedRequestWithUnsupportedFloorCurrency.imp[0].bidfloor;
let validBidRequests = utils.deepClone(bidRequests);
validBidRequests[0] = {
...validBidRequests[0],
Expand Down Expand Up @@ -482,7 +481,7 @@ describe('OguryBidAdapter', function () {
advertiserDomains: openRtbBidResponse.body.seatbid[0].bid[0].adomain
},
nurl: openRtbBidResponse.body.seatbid[0].bid[0].nurl,
adapterVersion: '1.2.10',
adapterVersion: '1.2.11',
prebidVersion: '$prebid.version$'
}, {
requestId: openRtbBidResponse.body.seatbid[0].bid[1].impid,
Expand All @@ -499,7 +498,7 @@ describe('OguryBidAdapter', function () {
advertiserDomains: openRtbBidResponse.body.seatbid[0].bid[1].adomain
},
nurl: openRtbBidResponse.body.seatbid[0].bid[1].nurl,
adapterVersion: '1.2.10',
adapterVersion: '1.2.11',
prebidVersion: '$prebid.version$'
}]

Expand Down

0 comments on commit 2651c7b

Please sign in to comment.