Skip to content

Commit

Permalink
Single-size sizes array now can be taken, too (#1535)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
olya-fb authored and jaiminpanchal27 committed Aug 31, 2017
1 parent 65e0fed commit b425bad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/spotxBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit b425bad

Please sign in to comment.