From de7ac85981b1ba3ad8c5d1dc95c5dadbdf5b9895 Mon Sep 17 00:00:00 2001 From: Fatih Kaya Date: Fri, 4 Nov 2022 10:29:39 +0300 Subject: [PATCH] Admatic adapter: host param control changed --- modules/admaticBidAdapter.js | 6 +++++- test/spec/modules/admaticBidAdapter_spec.js | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/admaticBidAdapter.js b/modules/admaticBidAdapter.js index b139b58da46..c20c263743c 100644 --- a/modules/admaticBidAdapter.js +++ b/modules/admaticBidAdapter.js @@ -20,7 +20,7 @@ export const spec = { let isValid = false; if (typeof bid.params !== 'undefined') { let isValidNetworkId = _validateId(getValue(bid.params, 'networkId')); - let isValidHost = getValue(bid.params, 'host'); + let isValidHost = _validateString(getValue(bid.params, 'host')); isValid = isValidNetworkId && isValidHost; } @@ -198,4 +198,8 @@ function _validateId(id) { return (parseInt(id) > 0); } +function _validateString(str) { + return (typeof str == 'string'); +} + registerBidder(spec); diff --git a/test/spec/modules/admaticBidAdapter_spec.js b/test/spec/modules/admaticBidAdapter_spec.js index c7d391cfaca..ffe2274ae7b 100644 --- a/test/spec/modules/admaticBidAdapter_spec.js +++ b/test/spec/modules/admaticBidAdapter_spec.js @@ -3,7 +3,7 @@ import {spec, storage} from 'modules/admaticBidAdapter.js'; import {newBidder} from 'src/adapters/bidderFactory.js'; import {getStorageManager} from 'src/storageManager'; -const ENDPOINT = 'https://layer.serve.admatic.com.tr/v1'; +const ENDPOINT = 'https://layer.serve.admatic.com.tr/pb'; describe('admaticBidAdapter', () => { const adapter = newBidder(spec); @@ -18,7 +18,8 @@ describe('admaticBidAdapter', () => { let bid = { 'bidder': 'admatic', 'params': { - 'networkId': 10433394 + 'networkId': 10433394, + 'host': 'layer.serve.admatic.com.tr' }, 'adUnitCode': 'adunit-code', 'sizes': [[300, 250], [300, 600]], @@ -37,7 +38,8 @@ describe('admaticBidAdapter', () => { delete bid.params; bid.params = { - 'networkId': 0 + 'networkId': 0, + 'host': 'layer.serve.admatic.com.tr' }; expect(spec.isBidRequestValid(bid)).to.equal(false);