Skip to content

Commit

Permalink
ZetaGlobalSsp Bid Adapter : cleanup object (#11049)
Browse files Browse the repository at this point in the history
* ZetaGlobalSsp adapter: cleanup object

* Update zeta_global_sspBidAdapter.js

---------

Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
Co-authored-by: Alexey Surovenko <ASurovenko@vdhk6ddf9m.home>
Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
4 people authored Feb 4, 2024
1 parent 60b6ada commit 9961236
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export const spec = {
return {
method: 'POST',
url: url,
data: JSON.stringify(payload),
data: JSON.stringify(clearEmpties(payload)),
};
},

Expand Down Expand Up @@ -373,4 +373,17 @@ function provideMediaType(zetaBid, bid, bidRequest) {
}
}

function clearEmpties(o) {
for (let k in o) {
if (!o[k] || typeof o[k] !== 'object') {
continue;
}
clearEmpties(o[k]);
if (Object.keys(o[k]).length === 0) {
delete o[k];
}
}
return o;
}

registerBidder(spec);

0 comments on commit 9961236

Please sign in to comment.