Skip to content

Commit

Permalink
Merge branch 'prebid:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofequativ authored May 29, 2024
2 parents e716ec0 + 1cad24d commit a952041
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 32 deletions.
14 changes: 5 additions & 9 deletions modules/insticatorBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function buildVideo(bidRequest) {
let w = deepAccess(bidRequest, 'mediaTypes.video.w');
let h = deepAccess(bidRequest, 'mediaTypes.video.h');
const mimes = deepAccess(bidRequest, 'mediaTypes.video.mimes');
const placement = deepAccess(bidRequest, 'mediaTypes.video.placement') || 3;
const placement = deepAccess(bidRequest, 'mediaTypes.video.placement');
const plcmt = deepAccess(bidRequest, 'mediaTypes.video.plcmt') || undefined;
const playerSize = deepAccess(bidRequest, 'mediaTypes.video.playerSize');
const context = deepAccess(bidRequest, 'mediaTypes.video.context');
Expand Down Expand Up @@ -136,6 +136,10 @@ function buildVideo(bidRequest) {
}
}

if (placement && typeof placement !== 'undefined' && typeof placement === 'number') {
optionalParams['placement'] = placement;
}

if (plcmt) {
optionalParams['plcmt'] = plcmt;
}
Expand All @@ -145,7 +149,6 @@ function buildVideo(bidRequest) {
}

let videoObj = {
placement,
mimes,
w,
h,
Expand Down Expand Up @@ -595,13 +598,6 @@ function validateVideo(bid) {
return false;
}

const placement = deepAccess(bid, 'mediaTypes.video.placement');

if (typeof placement !== 'undefined' && typeof placement !== 'number') {
logError('insticator: video placement is not a number');
return false;
}

const plcmt = deepAccess(bid, 'mediaTypes.video.plcmt');

if (typeof plcmt !== 'undefined' && typeof plcmt !== 'number') {
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
25 changes: 3 additions & 22 deletions test/spec/modules/insticatorBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,25 +175,6 @@ describe('InsticatorBidAdapter', function () {
})).to.be.true;
})

it('should return false if video placement is not a number', () => {
expect(spec.isBidRequestValid({
...bidRequest,
...{
mediaTypes: {
video: {
mimes: [
'video/mp4',
'video/mpeg',
],
w: 250,
h: 300,
placement: 'NaN',
},
}
}
})).to.be.false;
});

it('should return false if video plcmt is not a number', () => {
expect(spec.isBidRequestValid({
...bidRequest,
Expand Down Expand Up @@ -224,7 +205,7 @@ describe('InsticatorBidAdapter', function () {
'video/mpeg',
],
playerSize: [250, 300],
placement: 1,
plcmt: 1,
},
}
}
Expand Down Expand Up @@ -293,7 +274,7 @@ describe('InsticatorBidAdapter', function () {
'video/mpeg',
],
playerSize: [250, 300],
placement: 1,
plcmt: 1,
},
}
},
Expand All @@ -306,7 +287,7 @@ describe('InsticatorBidAdapter', function () {
'video/x-flv',
'video/webm',
],
placement: 2,
plcmt: 2,
},
}
})).to.be.true;
Expand Down

0 comments on commit a952041

Please sign in to comment.