Skip to content

Commit

Permalink
change s2s adapter to filter out units with empty sizes array (#1179)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Cozi authored May 5, 2017
1 parent 38d6d3a commit f62114d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/adapters/prebidServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function PrebidServer() {
timeout_millis : config.timeout,
url: utils.getTopWindowUrl(),
prebid_version : '$prebid.version$',
ad_units : bidRequest.ad_units
ad_units : bidRequest.ad_units.filter(hasSizes)
};

const payload = JSON.stringify(requestJson);
Expand All @@ -41,6 +41,11 @@ function PrebidServer() {
});
};

// at this point ad units should have a size array either directly or mapped so filter for that
function hasSizes(unit) {
return unit.sizes && unit.sizes.length;
}

/* Notify Prebid of bid responses so bids can get in the auction */
function handleResponse(response) {
let result;
Expand Down

0 comments on commit f62114d

Please sign in to comment.