From 1d9e24dce90bb8ffe226463490ae9db0f55c2710 Mon Sep 17 00:00:00 2001 From: Olga Farber Date: Mon, 28 Aug 2017 17:28:58 +0300 Subject: [PATCH] Single-size sizes array now can be taken, too A bug was, that the only sizes array would be taken as [[640,480]], not as it is usually given as [640,480]. I fix this. --- modules/spotxBidAdapter.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/spotxBidAdapter.js b/modules/spotxBidAdapter.js index 3f8a028a947..e8ed973fe5f 100644 --- a/modules/spotxBidAdapter.js +++ b/modules/spotxBidAdapter.js @@ -57,8 +57,9 @@ function Spotx() { bid.url = adServerKVPs.spotx_ad_key; bid.cur = 'USD'; bid.bidderCode = 'spotx'; - bid.height = bidReq.sizes[0][1]; - bid.width = bidReq.sizes[0][0]; + var sizes = utils.isArray(bidReq.sizes[0]) ? bidReq.sizes[0] : bidReq.sizes; + bid.height = sizes[1]; + bid.width = sizes[0]; resp.bids.push(bid); KVP_Object = adServerKVPs; handleResponse(resp); @@ -86,8 +87,9 @@ function Spotx() { bid.vastUrl = url; bid.ad = url; - bid.width = bidReq.sizes[0][0]; - bid.height = bidReq.sizes[0][1]; + var sizes = utils.isArray(bidReq.sizes[0]) ? bidReq.sizes[0] : bidReq.sizes; + bid.height = sizes[1]; + bid.width = sizes[0]; } return bid;