From 8f47f4ac9b54358a39720c62d38e9b071a1e0fd0 Mon Sep 17 00:00:00 2001 From: Robert Ray Martinez III Date: Fri, 28 Jun 2019 12:27:25 -0700 Subject: [PATCH] Getting current window frames protocol, not assuming pub domain (#64) Merging since failing circleci issue is unrelated to this code change --- src/renderingManager.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderingManager.js b/src/renderingManager.js index f36104e1..8daaae9c 100644 --- a/src/renderingManager.js +++ b/src/renderingManager.js @@ -66,10 +66,11 @@ export function newRenderingManager(win, environment) { * @param {string} pubUrl Url of publisher page */ function renderCrossDomain(adId, pubAdServerDomain = '', pubUrl) { + let windowLocation = window.location; let parsedUrl = utils.parseUrl(pubUrl); let publisherDomain = parsedUrl.protocol + '://' + parsedUrl.host; - let adServerDomain = (pubAdServerDomain !== '') ? pubAdServerDomain : GOOGLE_IFRAME_HOSTNAME; - let fullAdServerDomain = parsedUrl.protocol + '://' + adServerDomain; + let adServerDomain = pubAdServerDomain || GOOGLE_IFRAME_HOSTNAME; + let fullAdServerDomain = windowLocation.protocol + '//' + adServerDomain; function renderAd(ev) { let key = ev.message ? 'message' : 'data';