Skip to content

Commit

Permalink
Merge pull request #4 from kubient/gdpr_consent_condition2
Browse files Browse the repository at this point in the history
fix-for-review
  • Loading branch information
alexartwww authored Jan 14, 2022
2 parents 1c6cfdf + 587d6e8 commit f395314
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions modules/kubientBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ export const spec = {
}

let values = {};

if (typeof gdprConsent.gdprApplies === 'boolean') {
values['gdpr'] = Number(gdprConsent.gdprApplies);
if (gdprConsent && typeof gdprConsent.consentString === 'string') {
if (gdprConsent) {
if (typeof gdprConsent.gdprApplies === 'boolean') {
values['gdpr'] = Number(gdprConsent.gdprApplies);
}
if (typeof gdprConsent.consentString === 'string') {
values['consent'] = gdprConsent.consentString;
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/kubientBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ describe('KubientAdapter', function () {
}
});
let syncs = spec.getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent);
// values['consent'] = consentString;
values['consent'] = consentString;
expect(syncs).to.be.an('array').and.to.have.length(1);
expect(syncs[0].type).to.equal('image');
expect(syncs[0].url).to.equal('https://matching.kubient.net/match/sp?' + encodeQueryData(values));
Expand Down Expand Up @@ -487,7 +487,7 @@ describe('KubientAdapter', function () {
}
});
let syncs = spec.getUserSyncs(syncOptions, serverResponses, gdprConsent, uspConsent);
// values['consent'] = consentString;
values['consent'] = consentString;
values['usp'] = uspConsent;
expect(syncs).to.be.an('array').and.to.have.length(1);
expect(syncs[0].type).to.equal('image');
Expand Down

0 comments on commit f395314

Please sign in to comment.