From e1c50106876d3e12990fc74ac00665ad54e4897c Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Wed, 23 Dec 2015 14:38:22 +0100 Subject: [PATCH] Don't return empty zones Criteo returns something like: zone1;zone2;zone3; in their cookie. This results in an array like: ['zone1', 'zone2', 'zone3', ''] We don't want this empty element. To prevent this from happening we remove the trailing semicolon from the cookie string before split(). --- src/adapters/criteo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/adapters/criteo.js b/src/adapters/criteo.js index 75d5e928e2c..5da825396f7 100644 --- a/src/adapters/criteo.js +++ b/src/adapters/criteo.js @@ -53,7 +53,7 @@ var CriteoAdapter = function CriteoAdapter() { adResponse = bidfactory.createBid(1); adResponse.bidderCode = 'criteo'; - adResponse.keys = content.split(';'); + adResponse.keys = content.replace(/\;$/, '').split(';'); } else { // Indicate an ad was not returned adResponse = bidfactory.createBid(2); @@ -71,4 +71,4 @@ var CriteoAdapter = function CriteoAdapter() { }; }; -module.exports = CriteoAdapter; \ No newline at end of file +module.exports = CriteoAdapter;