Skip to content

Commit

Permalink
PB-2650 - fixed bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhlm committed Oct 25, 2024
1 parent f9fa8fe commit 9b2319d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions modules/nextMillenniumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const SYNC_ENDPOINT = 'https://cookies.nextmillmedia.com/sync?gdpr={{.GDPR}}&gdp
const REPORT_ENDPOINT = 'https://report2.hb.brainlyads.com/statistics/metric';
const TIME_TO_LIVE = 360;
const DEFAULT_CURRENCY = 'USD';
const DEFAULT_TAMX = 1500;
const DEFAULT_TMAX = 1500;

const VIDEO_PARAMS_DEFAULT = {
api: undefined,
Expand Down Expand Up @@ -90,7 +90,7 @@ export const spec = {
window.nmmRefreshCounts = window.nmmRefreshCounts || {};
const site = getSiteObj();
const device = getDeviceObj();
const tmax = deepAccess(bidderRequest, 'timeout') || DEFAULT_TAMX;
const tmax = deepAccess(bidderRequest, 'timeout') || DEFAULT_TMAX;

const postBody = {
id: bidderRequest?.bidderRequestId,
Expand Down Expand Up @@ -365,8 +365,8 @@ export function setConsentStrings(postBody = {}, bidderRequest) {
};
};

if (config.getConfig('coppa')) {
postBody.regs.coppa = 1;
if (typeof bidderRequest?.ortb2?.regs?.coppa === 'number') {
postBody.regs.coppa = bidderRequest?.ortb2?.regs?.coppa;
};
};
};
Expand Down
6 changes: 4 additions & 2 deletions test/spec/modules/nextMillenniumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('nextMillenniumBidAdapterTests', () => {
uspConsent: '1---',
gppConsent: {gppString: 'DBACNYA~CPXxRfAPXxR', applicableSections: [7]},
gdprConsent: {consentString: 'kjfdniwjnifwenrif3', gdprApplies: true},
ortb2: {regs: {gpp: 'DSFHFHWEUYVDC', gpp_sid: [8, 9, 10]}},
ortb2: {regs: {gpp: 'DSFHFHWEUYVDC', gpp_sid: [8, 9, 10], coppa: 1}},
},
},

Expand All @@ -129,6 +129,7 @@ describe('nextMillenniumBidAdapterTests', () => {
gpp_sid: [7],
gdpr: 1,
us_privacy: '1---',
coppa: 1
},
},
},
Expand All @@ -139,7 +140,7 @@ describe('nextMillenniumBidAdapterTests', () => {
postBody: {},
bidderRequest: {
gdprConsent: {consentString: 'ewtewbefbawyadexv', gdprApplies: false},
ortb2: {regs: {gpp: 'DSFHFHWEUYVDC', gpp_sid: [8, 9, 10]}},
ortb2: {regs: {gpp: 'DSFHFHWEUYVDC', gpp_sid: [8, 9, 10], coppa: 0}},
},
},

Expand All @@ -149,6 +150,7 @@ describe('nextMillenniumBidAdapterTests', () => {
gpp: 'DSFHFHWEUYVDC',
gpp_sid: [8, 9, 10],
gdpr: 0,
coppa: 0,
},
},
},
Expand Down

0 comments on commit 9b2319d

Please sign in to comment.