Skip to content

Commit 9961236

Browse files
asurovenko-zetasurovenkoAlexey SurovenkoChrisHuie
authored
ZetaGlobalSsp Bid Adapter : cleanup object (#11049)
* ZetaGlobalSsp adapter: cleanup object * Update zeta_global_sspBidAdapter.js --------- Co-authored-by: Surovenko Alexey <[email protected]> Co-authored-by: Alexey Surovenko <[email protected]> Co-authored-by: Chris Huie <[email protected]>
1 parent 60b6ada commit 9961236

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

modules/zeta_global_sspBidAdapter.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export const spec = {
178178
return {
179179
method: 'POST',
180180
url: url,
181-
data: JSON.stringify(payload),
181+
data: JSON.stringify(clearEmpties(payload)),
182182
};
183183
},
184184

@@ -373,4 +373,17 @@ function provideMediaType(zetaBid, bid, bidRequest) {
373373
}
374374
}
375375

376+
function clearEmpties(o) {
377+
for (let k in o) {
378+
if (!o[k] || typeof o[k] !== 'object') {
379+
continue;
380+
}
381+
clearEmpties(o[k]);
382+
if (Object.keys(o[k]).length === 0) {
383+
delete o[k];
384+
}
385+
}
386+
return o;
387+
}
388+
376389
registerBidder(spec);

0 commit comments

Comments
 (0)