Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prebid 9.0: fix consent getconfigs #11592

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions modules/apstreamBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,14 @@ function getConsentStringFromPrebid(gdprConsentConfig) {
return null;
}

let isIab = config.getConfig('consentManagement.cmpApi') != 'static';
let vendorConsents = (
gdprConsentConfig.vendorData.vendorConsents ||
(gdprConsentConfig.vendorData.vendor || {}).consents ||
{}
);
let isConsentGiven = !!vendorConsents[CONSTANTS.GVLID.toString(10)];

return isIab && isConsentGiven ? consentString : null;
return isConsentGiven ? consentString : null;
}

function getIabConsentString(bidderRequest) {
Expand Down
3 changes: 1 addition & 2 deletions modules/madvertiseBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { parseSizesInput, _each } from '../src/utils.js';
import {config} from '../src/config.js';
import {registerBidder} from '../src/adapters/bidderFactory.js';

/**
Expand Down Expand Up @@ -55,7 +54,7 @@ export const spec = {
}

if (bidderRequest && bidderRequest.gdprConsent) {
src = src + '&gdpr=' + (bidderRequest.gdprConsent.gdprApplies ? '1' : '0') + '&consent[0][format]=' + config.getConfig('consentManagement.cmpApi') + '&consent[0][value]=' + bidderRequest.gdprConsent.consentString;
src = src + '&gdpr=' + (bidderRequest.gdprConsent.gdprApplies ? '1' : '0') + '&consent[0][format]=iab&consent[0][value]=' + bidderRequest.gdprConsent.consentString;
}

return {
Expand Down
2 changes: 1 addition & 1 deletion modules/sirdataRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export function removePII(content) {
* @returns {Object} - The sanitized content
*/
export function sanitizeContent(content) {
if (content && content.documentElement.innerText && content.documentElement.innerText.length > 500) {
if (content && content.documentElement.textContent && content.documentElement.textContent.length > 500) {
// Reduce size by removing useless content
// Allowed tags
const allowedTags = [
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/madvertiseBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('madvertise adapater', () => {
expect(req[0].url).to.contain(`&zoneId=test`);
expect(req[0].url).to.contain(`&sizes[0]=728x90`);
expect(req[0].url).to.contain(`&gdpr=1`);
expect(req[0].url).to.contain(`&consent[0][format]=IAB`);
expect(req[0].url).to.contain(`&consent[0][format]=iab`);
expect(req[0].url).to.contain(`&consent[0][value]=CO_5mtSPHOmEIAsAkBFRBOCsAP_AAH_AAAqIHQgB7SrERyNAYWB5gusAKYlfQAQCA2AABAYdASgJQQBAMJYEkGAIuAnAACAKAAAEIHQAAAAlCCmABAEAAIABBSGMAQgABZAAIiAEEAATAABACAABGYCSCAIQjIAAAAEAgEKEAAoAQGBAAAEgBABAAAogACADAgXmACIKkQBAkBAYAkAYQAogAhAAAAAIAAAAAAAKAABAAAghAAQQAAAAAAAAAgAAAAABAAAAAAAAQAAAAAAAAABAAgAAAAAAAAAIAAAAAAAAAAAAAAAABAAAAAAAAAAAQCAKCgBgEQALgAqkJADAIgAXABVIaACAAERABAACKgAgABA`)
});

Expand Down