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 Dec 2, 2021
1 parent 5c427b0 commit 001781f
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 001781f

Please sign in to comment.