Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change s2s adapter to filter out units with empty sizes array #1179

Merged
merged 1 commit into from
May 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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