diff --git a/modules/prebidServerBidAdapter/index.js b/modules/prebidServerBidAdapter/index.js index 54d4b32e676..4c6ef3fd71c 100644 --- a/modules/prebidServerBidAdapter/index.js +++ b/modules/prebidServerBidAdapter/index.js @@ -669,17 +669,18 @@ const OPEN_RTB_PROTOCOL = { request.ext.prebid = Object.assign(request.ext.prebid, _s2sConfig.extPrebid); } - /** - * @type {(string[]|string|undefined)} - OpenRTB property 'cur', currencies available for bids - */ - const adServerCur = config.getConfig('currency.adServerCurrency'); - if (adServerCur && typeof adServerCur === 'string') { - // if the value is a string, wrap it with an array - request.cur = [adServerCur]; - } else if (Array.isArray(adServerCur) && adServerCur.length) { - // if it's an array, get the first element - request.cur = [adServerCur[0]]; - } + // TEMPORARY REMOVED + // /** + // * @type {(string[]|string|undefined)} - OpenRTB property 'cur', currencies available for bids + // */ + // const adServerCur = config.getConfig('currency.adServerCurrency'); + // if (adServerCur && typeof adServerCur === 'string') { + // // if the value is a string, wrap it with an array + // request.cur = [adServerCur]; + // } else if (Array.isArray(adServerCur) && adServerCur.length) { + // // if it's an array, get the first element + // request.cur = [adServerCur[0]]; + // } _appendSiteAppDevice(request); diff --git a/src/marfeelTools.js b/src/marfeelTools.js index ec8394b3161..034923dd1d5 100644 --- a/src/marfeelTools.js +++ b/src/marfeelTools.js @@ -18,14 +18,25 @@ var lastLocation; export const getLastLocation = () => lastLocation; +const extractLastLocationFromArray = (adUnitArr) => ( + adUnitArr && + adUnitArr[0] && + adUnitArr[0].bids && + adUnitArr[0].bids[0] && + adUnitArr[0].bids[0].params && + adUnitArr[0].bids[0].params.referrer) ? adUnitArr[0].bids[0].params.referrer : ''; + +const extractLastLocationFromObject = (adUnitArr) => ( + adUnitArr && + adUnitArr.bids && + adUnitArr.bids[0] && + adUnitArr.bids[0].params && + adUnitArr.bids[0].params.referrer) ? adUnitArr.bids[0].params.referrer : ''; + export const setLastLocationFromLastAdUnit = (adUnitArr) => { - try { - if (utils.isArray(adUnitArr)) { - lastLocation = adUnitArr[0].bids[0].params.referrer; - } else { - lastLocation = adUnitArr.bids[0].params.referrer; - } - } catch (error) { - console.error('Error while extracting lastLocation from adUnit', error); + if (utils.isArray(adUnitArr)) { + lastLocation = extractLastLocationFromArray(adUnitArr); + } else { + lastLocation = extractLastLocationFromObject(adUnitArr); } }