From 28e5801b58868234d7d71f2eb86c4ec47ca99a21 Mon Sep 17 00:00:00 2001 From: Albert Grandes Date: Wed, 5 Jan 2022 10:35:13 +0100 Subject: [PATCH 1/6] Tappx :: Adtypes bug :: solved --- modules/tappxBidAdapter.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index e2225156128..d5782ec301a 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -53,7 +53,14 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: function(bid) { - return validBasic(bid) && validMediaType(bid) + //bid.params.host + if ((new RegExp(`^(vz.*|zz.*)\\.*$`, 'i')).test(bid.params.host)) { //New endpoint + if((new RegExp(`^(zz.*)\\.*$`, 'i')).test(bid.params.host)) return validBasic(bid) + else return validBasic(bid) && validMediaType(bid) + } else { //This is backward compatible feature. It will be remove in the future + if((new RegExp(`^(ZZ.*)\\.*$`, 'i')).test(bid.params.endpoint)) return validBasic(bid) + else return validBasic(bid) && validMediaType(bid) + } }, /** From 927f8026e21c13efbdad3bf19d2f22cecdd16afa Mon Sep 17 00:00:00 2001 From: Albert Grandes Date: Wed, 5 Jan 2022 10:42:50 +0100 Subject: [PATCH 2/6] Tappx ::Mimes param is not mandatory now --- modules/tappxBidAdapter.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index d5782ec301a..a964cbd39a0 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -176,10 +176,6 @@ function validMediaType(bid) { logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Video context not supported.'); return false; } - if (typeof video.mimes == 'undefined') { - logWarn(LOG_PREFIX, 'Please review the mandatory Tappx parameters for Video. Mimes param is mandatory.'); - return false; - } } return true; From b5d31a514854df09b522efad91637e8064b48d4d Mon Sep 17 00:00:00 2001 From: Albert Grandes Date: Wed, 5 Jan 2022 10:59:16 +0100 Subject: [PATCH 3/6] Circle CI :: Aesthetic changes --- modules/tappxBidAdapter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/tappxBidAdapter.js b/modules/tappxBidAdapter.js index a964cbd39a0..769e8f73565 100644 --- a/modules/tappxBidAdapter.js +++ b/modules/tappxBidAdapter.js @@ -53,12 +53,12 @@ export const spec = { * @return boolean True if this is a valid bid, and false otherwise. */ isBidRequestValid: function(bid) { - //bid.params.host - if ((new RegExp(`^(vz.*|zz.*)\\.*$`, 'i')).test(bid.params.host)) { //New endpoint - if((new RegExp(`^(zz.*)\\.*$`, 'i')).test(bid.params.host)) return validBasic(bid) + // bid.params.host + if ((new RegExp(`^(vz.*|zz.*)\\.*$`, 'i')).test(bid.params.host)) { // New endpoint + if ((new RegExp(`^(zz.*)\\.*$`, 'i')).test(bid.params.host)) return validBasic(bid) else return validBasic(bid) && validMediaType(bid) - } else { //This is backward compatible feature. It will be remove in the future - if((new RegExp(`^(ZZ.*)\\.*$`, 'i')).test(bid.params.endpoint)) return validBasic(bid) + } else { // This is backward compatible feature. It will be remove in the future + if ((new RegExp(`^(ZZ.*)\\.*$`, 'i')).test(bid.params.endpoint)) return validBasic(bid) else return validBasic(bid) && validMediaType(bid) } }, From 674229ebe6a9d4044a79556e6a868ef86b837189 Mon Sep 17 00:00:00 2001 From: Albert Grandes Date: Wed, 5 Jan 2022 11:07:11 +0100 Subject: [PATCH 4/6] Test hotfix :: Mimes is not mandatory now --- test/spec/modules/tappxBidAdapter_spec.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/spec/modules/tappxBidAdapter_spec.js b/test/spec/modules/tappxBidAdapter_spec.js index 49d739ed3be..abc0a4515a8 100644 --- a/test/spec/modules/tappxBidAdapter_spec.js +++ b/test/spec/modules/tappxBidAdapter_spec.js @@ -134,12 +134,6 @@ describe('Tappx bid adapter', function () { assert.isTrue(spec.isBidRequestValid(c_BIDREQUEST.bids[0]), JSON.stringify(c_BIDREQUEST)); }); - it('should return false when params are missing', function () { - let badBidRequestParam = JSON.parse(JSON.stringify(c_BIDREQUEST)); - delete badBidRequestParam.bids[0].params; - assert.isFalse(spec.isBidRequestValid(badBidRequestParam.bids[0])); - }); - it('should return false when tappxkey is missing', function () { let badBidRequestTpxkey = JSON.parse(JSON.stringify(c_BIDREQUEST)); ; delete badBidRequestTpxkey.bids[0].params.tappxkey; From 055623aa89b9a0eb5395be92055dc7c037cd3be9 Mon Sep 17 00:00:00 2001 From: Albert Grandes Date: Wed, 5 Jan 2022 11:13:26 +0100 Subject: [PATCH 5/6] Tappx :: Mimes is not longer mandatory --- test/spec/modules/tappxBidAdapter_spec.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/spec/modules/tappxBidAdapter_spec.js b/test/spec/modules/tappxBidAdapter_spec.js index abc0a4515a8..09a9c106c38 100644 --- a/test/spec/modules/tappxBidAdapter_spec.js +++ b/test/spec/modules/tappxBidAdapter_spec.js @@ -159,15 +159,6 @@ describe('Tappx bid adapter', function () { assert.isTrue(spec.isBidRequestValid(badBidRequestNwEp.bids[0])); }); - it('should return false mimes param is missing', function () { - let badBidRequest_mimes = c_BIDDERREQUEST_V; - delete badBidRequest_mimes.bids.mediaTypes.video; - badBidRequest_mimes.bids.mediaTypes.video = {}; - badBidRequest_mimes.bids.mediaTypes.video.context = 'instream'; - badBidRequest_mimes.bids.mediaTypes.video.playerSize = [320, 250]; - assert.isFalse(spec.isBidRequestValid(badBidRequest_mimes.bids), badBidRequest_mimes); - }); - it('should return false for not instream/outstream requests', function () { let badBidRequest_v = c_BIDDERREQUEST_V; delete badBidRequest_v.bids.mediaTypes.banner; From 5fd8b99b106bc7c93cbf4b43c9ad373463d49925 Mon Sep 17 00:00:00 2001 From: Albert Grandes Date: Wed, 5 Jan 2022 11:14:40 +0100 Subject: [PATCH 6/6] Tappx :: Remove mimes references. Is not mandatory --- test/spec/modules/tappxBidAdapter_spec.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/spec/modules/tappxBidAdapter_spec.js b/test/spec/modules/tappxBidAdapter_spec.js index 09a9c106c38..8866670df77 100644 --- a/test/spec/modules/tappxBidAdapter_spec.js +++ b/test/spec/modules/tappxBidAdapter_spec.js @@ -164,7 +164,6 @@ describe('Tappx bid adapter', function () { delete badBidRequest_v.bids.mediaTypes.banner; badBidRequest_v.bids.mediaTypes.video = {}; badBidRequest_v.bids.mediaTypes.video.context = ''; - badBidRequest_v.bids.mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; badBidRequest_v.bids.mediaTypes.video.playerSize = [320, 250]; assert.isFalse(spec.isBidRequestValid(badBidRequest_v.bids)); }); @@ -217,7 +216,6 @@ describe('Tappx bid adapter', function () { validBidRequests_V[0].mediaTypes.video = {}; validBidRequests_V[0].mediaTypes.video.playerSize = [640, 480]; validBidRequests_V[0].mediaTypes.video.context = 'instream'; - validBidRequests_V[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; bidderRequest_V.bids.mediaTypes.context = 'instream'; @@ -237,7 +235,6 @@ describe('Tappx bid adapter', function () { validBidRequests_Voutstream[0].mediaTypes.video = {}; validBidRequests_Voutstream[0].mediaTypes.video.playerSize = [640, 480]; validBidRequests_Voutstream[0].mediaTypes.video.context = 'outstream'; - validBidRequests_Voutstream[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; bidderRequest_VOutstream.bids.mediaTypes.context = 'outstream'; @@ -258,7 +255,6 @@ describe('Tappx bid adapter', function () { validBidRequests_Voutstream[0].mediaTypes.video.rewarded = 1; validBidRequests_Voutstream[0].mediaTypes.video.playerSize = [640, 480]; validBidRequests_Voutstream[0].mediaTypes.video.context = 'outstream'; - validBidRequests_Voutstream[0].mediaTypes.video.mimes = [ 'video/mp4', 'application/javascript' ]; bidderRequest_VOutstream.bids.mediaTypes.context = 'outstream';