Skip to content

Commit

Permalink
Adding mediaType param to parseSizes in order to ALWAYS get the corre…
Browse files Browse the repository at this point in the history
…ct parse Size method correct. (prebid#3166)
  • Loading branch information
Robert Ray Martinez III authored and Pedro López Jiménez committed Mar 18, 2019
1 parent 7ce9545 commit 0b9b428
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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 || [];

Expand Down Expand Up @@ -529,9 +529,9 @@ function _renderCreative(script, impId) {
</html>`;
}

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 = [
Expand Down Expand Up @@ -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.');
}
Expand Down

0 comments on commit 0b9b428

Please sign in to comment.