diff --git a/share-through/CHANGES.md b/share-through/CHANGES.md index d848e8b4..646008a0 100644 --- a/share-through/CHANGES.md +++ b/share-through/CHANGES.md @@ -1,3 +1,7 @@ +# 2.2.0 +- Use an `https` endpoint +- Send `secure` param + # 2.1.2 - Add support for Unified ID in `__generateRequestObj` function of adapter code diff --git a/share-through/DOCUMENTATION.md b/share-through/DOCUMENTATION.md index 3767f24a..004b487e 100644 --- a/share-through/DOCUMENTATION.md +++ b/share-through/DOCUMENTATION.md @@ -50,7 +50,7 @@ bidId: "_fakeBidId", instant_play_capable: "true", hbSource: "indexExchange", - hbVersion: "2.1.2", + hbVersion: "2.2.0", cbust: System.now() }; ``` diff --git a/share-through/share-through-htb-system-tests.js b/share-through/share-through-htb-system-tests.js index e0c3f7e6..666793f8 100644 --- a/share-through/share-through-htb-system-tests.js +++ b/share-through/share-through-htb-system-tests.js @@ -10,7 +10,7 @@ function getStatsId() { function getBidRequestRegex() { return { method: "GET", - urlRegex: /.*btlr\.sharethrough\.com\/t6oivhQt\/.*/ + urlRegex: /https:\/\/btlr\.sharethrough\.com\/t6oivhQt\/.*/ }; } @@ -44,9 +44,10 @@ function validateBidRequest(request) { expect(queryObj.placement_key).toEqual("abc123"); expect(queryObj.instant_play_capable).toBeDefined(); expect(queryObj.hbSource).toEqual("indexExchange"); - expect(queryObj.hbVersion).toEqual("2.1.2"); + expect(queryObj.hbVersion).toEqual("2.2.0"); expect(queryObj.cbust).toBeDefined(); expect(queryObj.consent_required).toEqual("false"); + expect(queryObj.secure).toBeDefined(); } function validateBidRequestWithPrivacy(request) { @@ -68,7 +69,7 @@ function getValidResponse(request, creative) { creatives: [ { adm: creative, - cpm: 2, + cpm: 2 } ] }); diff --git a/share-through/share-through-htb.js b/share-through/share-through-htb.js index 87a299f4..6eb4dba2 100644 --- a/share-through/share-through-htb.js +++ b/share-through/share-through-htb.js @@ -83,17 +83,20 @@ function ShareThroughHtb(configs) { * @return {object} */ function __generateRequestObj(returnParcels) { - var baseUrl = Browser.getProtocol() + '//btlr.sharethrough.com/t6oivhQt/v1'; + var baseUrl = 'https://btlr.sharethrough.com/t6oivhQt/v1'; var queryObj = { placement_key: returnParcels[0].xSlotRef.placementKey, bidId: returnParcels[0].requestId, instant_play_capable: __canAutoPlayHTML5Video(), hbSource: "indexExchange", - hbVersion: "2.1.2", + hbVersion: "2.2.0", cbust: System.now() }; + var nonHttp = __getProtocol().indexOf('http') < 0; + queryObj.secure = nonHttp || (__getProtocol().indexOf('https') > -1); + var unifiedID = __getUnifiedID(returnParcels); if (unifiedID) { queryObj.ttduid = unifiedID; @@ -160,6 +163,10 @@ function ShareThroughHtb(configs) { } } + function __getProtocol() { + return document.location.protocol; + } + /* ============================================================================= * STEP 5 | Rendering Pixel * ----------------------------------------------------------------------------- @@ -345,7 +352,7 @@ function ShareThroughHtb(configs) { partnerId: 'ShareThroughHtb', // PartnerName namespace: 'ShareThroughHtb', // Should be same as partnerName statsId: 'SHTH', // Unique partner identifier - version: '2.1.2', + version: '2.2.0', targetingType: 'slot', enabledAnalytics: { requestTime: true @@ -385,7 +392,8 @@ function ShareThroughHtb(configs) { __baseClass = Partner(__profile, configs, null, { parseResponse: __parseResponse, generateRequestObj: __generateRequestObj, - b64EncodeUnicode: __b64EncodeUnicode + b64EncodeUnicode: __b64EncodeUnicode, + getProtocol: __getProtocol }); })();