From 3b7c0ef03b06c7b4180ad0f3d028bc5f6f04362a Mon Sep 17 00:00:00 2001 From: Omer Koren Date: Thu, 15 Feb 2018 19:11:12 +0200 Subject: [PATCH] Fix bug in UndertoneBidAdapter (#2027) * fix bug in UndertoneBidAdapter Fix bug that caused the page domain to be sent as an array instead of a string. Also added a page url parameter to the request * fix lint error * fix lint error --- modules/undertoneBidAdapter.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/undertoneBidAdapter.js b/modules/undertoneBidAdapter.js index 1fe139d6fbe..ae9abee8e88 100644 --- a/modules/undertoneBidAdapter.js +++ b/modules/undertoneBidAdapter.js @@ -20,8 +20,13 @@ export const spec = { const payload = { 'x-ut-hb-params': [] }; - const host = utils.getTopWindowLocation().host; - const domain = /[-\w]+\.(?:[-\w]+\.xn--[-\w]+|[-\w]{3,}|[-\w]+\.[-\w]{2})$/i.exec(host); + const location = utils.getTopWindowLocation(); + let domain = /[-\w]+\.(?:[-\w]+\.xn--[-\w]+|[-\w]{3,}|[-\w]+\.[-\w]{2})$/i.exec(location.host); + if (domain == null || domain.length == 0) { + domain = null; + } else { + domain = domain[0]; + } const pubid = validBidRequests[0].params.publisherId; const REQ_URL = `${URL}?pid=${pubid}&domain=${domain}`; @@ -30,6 +35,7 @@ export const spec = { const bid = { bidRequestId: bidReq.bidId, hbadaptor: 'prebid', + url: location.href, domain: domain, placementId: bidReq.params.placementId, publisherId: bidReq.params.publisherId,