@@ -40,8 +40,6 @@ const cache = {
40
40
timeouts : { } ,
41
41
} ;
42
42
43
- const validFloorProviders = [ 'rubicon' , 'rubi' , 'magnite' , 'mgni' ] ;
44
-
45
43
export function getHostNameFromReferer ( referer ) {
46
44
try {
47
45
rubiconAdapter . referrerHostname = utils . parseUrl ( referer , { noDecodeWholeURL : true } ) . hostname ;
@@ -205,12 +203,13 @@ function sendMessage(auctionId, bidWonId) {
205
203
} else {
206
204
auction . floors = utils . pick ( auctionCache . floorData , [
207
205
'location' ,
208
- 'modelName' , ( ) => auctionCache . floorData . modelVersion ,
206
+ 'modelVersion as modelName' ,
209
207
'skipped' ,
210
208
'enforcement' , ( ) => utils . deepAccess ( auctionCache . floorData , 'enforcements.enforceJS' ) ,
211
209
'dealsEnforced' , ( ) => utils . deepAccess ( auctionCache . floorData , 'enforcements.floorDeals' ) ,
212
210
'skipRate' ,
213
- 'fetchStatus'
211
+ 'fetchStatus' ,
212
+ 'floorProvider as provider'
214
213
] ) ;
215
214
}
216
215
}
@@ -285,7 +284,7 @@ export function parseBidResponse(bid, previousBidResponse, auctionFloorData) {
285
284
if ( previousBidResponse && previousBidResponse . bidPriceUSD > responsePrice ) {
286
285
return previousBidResponse ;
287
286
}
288
- let bidResponse = utils . pick ( bid , [
287
+ return utils . pick ( bid , [
289
288
'bidPriceUSD' , ( ) => responsePrice ,
290
289
'dealId' ,
291
290
'status' ,
@@ -295,12 +294,9 @@ export function parseBidResponse(bid, previousBidResponse, auctionFloorData) {
295
294
'height'
296
295
] ) ,
297
296
'seatBidId' ,
297
+ 'floorValue' , ( ) => utils . deepAccess ( bid , 'floorData.floorValue' ) ,
298
+ 'floorRule' , ( ) => utils . debugTurnedOn ( ) ? utils . deepAccess ( bid , 'floorData.floorRule' ) : undefined
298
299
] ) ;
299
- if ( auctionFloorData ) {
300
- bidResponse . floorValue = utils . deepAccess ( bid , 'floorData.floorValue' ) ;
301
- bidResponse . floorRule = utils . debugTurnedOn ( ) ? utils . deepAccess ( bid , 'floorData.floorRule' ) : undefined
302
- }
303
- return bidResponse ;
304
300
}
305
301
306
302
let samplingFactor = 1 ;
@@ -380,9 +376,9 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
380
376
cacheEntry . bids = { } ;
381
377
cacheEntry . bidsWon = { } ;
382
378
cacheEntry . referrer = args . bidderRequests [ 0 ] . refererInfo . referer ;
383
- const floorProvider = utils . deepAccess ( args , 'bidderRequests.0.bids.0.floorData.floorProvider ' ) ;
384
- if ( validFloorProviders . indexOf ( floorProvider ) !== - 1 ) {
385
- cacheEntry . floorData = { ...args . bidderRequests [ 0 ] . bids [ 0 ] . floorData } ;
379
+ const floorData = utils . deepAccess ( args , 'bidderRequests.0.bids.0.floorData' ) ;
380
+ if ( floorData ) {
381
+ cacheEntry . floorData = { ...floorData } ;
386
382
}
387
383
cache . auctions [ args . auctionId ] = cacheEntry ;
388
384
break ;
@@ -468,7 +464,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
468
464
bid . adUnit . adSlot = args . floorData . matchedFields . gptSlot ;
469
465
}
470
466
// if we have not set enforcements yet set it
471
- if ( auctionEntry . floorData && ! auctionEntry . floorData . enforcements && utils . deepAccess ( args , 'floorData.enforcements' ) ) {
467
+ if ( ! utils . deepAccess ( auctionEntry , ' floorData.enforcements' ) && utils . deepAccess ( args , 'floorData.enforcements' ) ) {
472
468
auctionEntry . floorData . enforcements = { ...args . floorData . enforcements } ;
473
469
}
474
470
if ( ! bid ) {
@@ -492,7 +488,7 @@ let rubiconAdapter = Object.assign({}, baseAdapter, {
492
488
} ;
493
489
}
494
490
bid . clientLatencyMillis = Date . now ( ) - cache . auctions [ args . auctionId ] . timestamp ;
495
- bid . bidResponse = parseBidResponse ( args , bid . bidResponse , auctionEntry . floorData ) ;
491
+ bid . bidResponse = parseBidResponse ( args , bid . bidResponse ) ;
496
492
break ;
497
493
case BIDDER_DONE :
498
494
args . bids . forEach ( bid => {
0 commit comments