diff --git a/modules/glimpseBidAdapter.js b/modules/glimpseBidAdapter.js index 7bcf8cf3a7d..7ee3717a84b 100644 --- a/modules/glimpseBidAdapter.js +++ b/modules/glimpseBidAdapter.js @@ -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, } } @@ -182,6 +183,13 @@ function hasValue(value) { ) } +function hasBooleanValue(value) { + return ( + hasValue(value) && + typeof value === 'boolean' + ) +} + function hasStringValue(value) { return ( hasValue(value) &&