Skip to content

Commit

Permalink
Fix bug in UndertoneBidAdapter (#2027)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
omerko authored and matthewlane committed Feb 15, 2018
1 parent 45154a0 commit 3b7c0ef
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions modules/undertoneBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand All @@ -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,
Expand Down

0 comments on commit 3b7c0ef

Please sign in to comment.