Skip to content

Commit

Permalink
Handle consent case where GDPR doesn't apply (prebid#7783)
Browse files Browse the repository at this point in the history
  • Loading branch information
samueldobbie authored and Chris Pabst committed Jan 10, 2022
1 parent fddd222 commit 68b943a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/glimpseBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,12 @@ function getGdprConsentChoice(bidderRequest) {

if (hasGdprConsent) {
const gdprConsent = bidderRequest.gdprConsent
const hasGdprApplies = hasBooleanValue(gdprConsent.gdprApplies)

return {
consentString: gdprConsent.consentString || '',
vendorData: gdprConsent.vendorData || {},
gdprApplies: gdprConsent.gdprApplies || true,
gdprApplies: hasGdprApplies ? gdprConsent.gdprApplies : true,
}
}

Expand Down Expand Up @@ -182,6 +183,13 @@ function hasValue(value) {
)
}

function hasBooleanValue(value) {
return (
hasValue(value) &&
typeof value === 'boolean'
)
}

function hasStringValue(value) {
return (
hasValue(value) &&
Expand Down

0 comments on commit 68b943a

Please sign in to comment.