From e68454754b19c54d23581c1d362d0cd056a2a06d Mon Sep 17 00:00:00 2001 From: Artem Aleksashkin Date: Fri, 14 Jan 2022 17:33:40 +0300 Subject: [PATCH 1/3] fix-for-review --- modules/kubientBidAdapter.js | 6 +++--- test/spec/modules/kubientBidAdapter_spec.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/kubientBidAdapter.js b/modules/kubientBidAdapter.js index 380b4368558..fe9f41de8ca 100644 --- a/modules/kubientBidAdapter.js +++ b/modules/kubientBidAdapter.js @@ -124,9 +124,9 @@ export const spec = { if (typeof gdprConsent.gdprApplies === 'boolean') { values['gdpr'] = Number(gdprConsent.gdprApplies); - if (gdprConsent && typeof gdprConsent.consentString === 'string') { - values['consent'] = gdprConsent.consentString; - } + values['consent'] = gdprConsent.consentString; + } else { + values['consent'] = gdprConsent.consentString; } if (uspConsent) { diff --git a/test/spec/modules/kubientBidAdapter_spec.js b/test/spec/modules/kubientBidAdapter_spec.js index 8e4264b4fd7..2d3801450ba 100644 --- a/test/spec/modules/kubientBidAdapter_spec.js +++ b/test/spec/modules/kubientBidAdapter_spec.js @@ -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)); @@ -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'); From e1695545455bbc2dfbab443cbd823ecbcd242d8f Mon Sep 17 00:00:00 2001 From: Artem Aleksashkin Date: Fri, 14 Jan 2022 19:41:29 +0300 Subject: [PATCH 2/3] fix --- modules/kubientBidAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/kubientBidAdapter.js b/modules/kubientBidAdapter.js index fe9f41de8ca..6671f7194cf 100644 --- a/modules/kubientBidAdapter.js +++ b/modules/kubientBidAdapter.js @@ -124,8 +124,8 @@ export const spec = { if (typeof gdprConsent.gdprApplies === 'boolean') { values['gdpr'] = Number(gdprConsent.gdprApplies); - values['consent'] = gdprConsent.consentString; - } else { + } + if (typeof gdprConsent.consentString === 'string') { values['consent'] = gdprConsent.consentString; } From 587d6e8c4f26bb0d3b03b3b012ebdd510cbf9172 Mon Sep 17 00:00:00 2001 From: Artem Aleksashkin Date: Fri, 14 Jan 2022 20:30:15 +0300 Subject: [PATCH 3/3] fix --- modules/kubientBidAdapter.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/kubientBidAdapter.js b/modules/kubientBidAdapter.js index 6671f7194cf..fd776793d91 100644 --- a/modules/kubientBidAdapter.js +++ b/modules/kubientBidAdapter.js @@ -121,12 +121,13 @@ export const spec = { } let values = {}; - - if (typeof gdprConsent.gdprApplies === 'boolean') { - values['gdpr'] = Number(gdprConsent.gdprApplies); - } - if (typeof gdprConsent.consentString === 'string') { - values['consent'] = gdprConsent.consentString; + if (gdprConsent) { + if (typeof gdprConsent.gdprApplies === 'boolean') { + values['gdpr'] = Number(gdprConsent.gdprApplies); + } + if (typeof gdprConsent.consentString === 'string') { + values['consent'] = gdprConsent.consentString; + } } if (uspConsent) {