Skip to content

Commit

Permalink
Update for 'Adapters that may not handle GDPR-Applies correctly #7775' (
Browse files Browse the repository at this point in the history
#7788)

Co-authored-by: sgimenez <sergi.gimenez@richaudience.com>
  • Loading branch information
richaudience and richaudience authored Dec 1, 2021
1 parent 68c833f commit fb0a73a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions modules/richaudienceBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ export const spec = {
REFERER = (typeof bidderRequest.refererInfo.referer != 'undefined' ? encodeURIComponent(bidderRequest.refererInfo.referer) : null)

payload.gdpr_consent = '';
payload.gdpr = null;
payload.gdpr = bidderRequest.gdprConsent.gdprApplies;

This comment has been minimized.

Copy link
@jlabrada71

jlabrada71 Dec 1, 2021

if gdprConsent is null this will trigger a null exception. That was caught up by the if condition.


if (bidderRequest && bidderRequest.gdprConsent) {
payload.gdpr_consent = bidderRequest.gdprConsent.consentString;
payload.gdpr = bidderRequest.gdprConsent.gdprApplies;
}

var payloadString = JSON.stringify(payload);
Expand Down
4 changes: 2 additions & 2 deletions test/spec/modules/richaudienceBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ describe('Richaudience adapter tests', function () {
}, [], {
consentString: null,
referer: 'http://domain.com',
gdprApplies: true
gdprApplies: false
})
expect(syncs).to.have.lengthOf(1);
expect(syncs[0].type).to.equal('image');
Expand Down Expand Up @@ -942,7 +942,7 @@ describe('Richaudience adapter tests', function () {
}, [], {
consentString: null,
referer: 'http://domain.com',
gdprApplies: true
gdprApplies: false
})
expect(syncs).to.have.lengthOf(0);
});
Expand Down

0 comments on commit fb0a73a

Please sign in to comment.