Skip to content

Commit f62114d

Browse files
author
Nate Cozi
authored
change s2s adapter to filter out units with empty sizes array (#1179)
1 parent 38d6d3a commit f62114d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/adapters/prebidServer.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function PrebidServer() {
3131
timeout_millis : config.timeout,
3232
url: utils.getTopWindowUrl(),
3333
prebid_version : '$prebid.version$',
34-
ad_units : bidRequest.ad_units
34+
ad_units : bidRequest.ad_units.filter(hasSizes)
3535
};
3636

3737
const payload = JSON.stringify(requestJson);
@@ -41,6 +41,11 @@ function PrebidServer() {
4141
});
4242
};
4343

44+
// at this point ad units should have a size array either directly or mapped so filter for that
45+
function hasSizes(unit) {
46+
return unit.sizes && unit.sizes.length;
47+
}
48+
4449
/* Notify Prebid of bid responses so bids can get in the auction */
4550
function handleResponse(response) {
4651
let result;

0 commit comments

Comments
 (0)