From 18107d8f1807b3dd0b84a9ea54a7f21b9a2d8d30 Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Wed, 10 Oct 2018 10:19:23 -0700 Subject: [PATCH] Adding mediaType param to parseSizes in order to ALWAYS get the correct parse Size method correct. (#3166) --- modules/rubiconBidAdapter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js index e54b4999144..122164f6a09 100644 --- a/modules/rubiconBidAdapter.js +++ b/modules/rubiconBidAdapter.js @@ -111,7 +111,7 @@ export const spec = { bidRequest.startTime = new Date().getTime(); let params = bidRequest.params; - let size = parseSizes(bidRequest); + let size = parseSizes(bidRequest, 'video'); let data = { page_url: _getPageUrl(bidRequest, bidderRequest), @@ -306,7 +306,7 @@ export const spec = { const params = bidRequest.params; // use rubicon sizes if provided, otherwise adUnit.sizes - const parsedSizes = parseSizes(bidRequest); + const parsedSizes = parseSizes(bidRequest, 'banner'); const [latitude, longitude] = params.latLong || []; @@ -529,9 +529,9 @@ function _renderCreative(script, impId) { `; } -function parseSizes(bid) { +function parseSizes(bid, mediaType) { let params = bid.params; - if (hasVideoMediaType(bid)) { + if (mediaType === 'video') { let size = []; if (params.video && params.video.playerWidth && params.video.playerHeight) { size = [ @@ -624,7 +624,7 @@ function bidType(bid, log = false) { return undefined; } } - if (parseSizes(bid).length > 0) { + if (parseSizes(bid, 'banner').length > 0) { if (log && validVideo === false) { utils.logWarn('Rubicon bid adapter Warning: invalid video requested for adUnit, continuing with banner request.'); }