Skip to content

Commit

Permalink
Merge pull request #179 from indexexchange/canary
Browse files Browse the repository at this point in the history
Promote sharethrough SSL update to production
  • Loading branch information
ix-certification authored Mar 24, 2020
2 parents 38e55a8 + ad64c44 commit d2461e5
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
4 changes: 4 additions & 0 deletions share-through/CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion share-through/DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
bidId: "_fakeBidId",
instant_play_capable: "true",
hbSource: "indexExchange",
hbVersion: "2.1.2",
hbVersion: "2.2.0",
cbust: System.now()
};
```
Expand Down
7 changes: 4 additions & 3 deletions share-through/share-through-htb-system-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function getStatsId() {
function getBidRequestRegex() {
return {
method: "GET",
urlRegex: /.*btlr\.sharethrough\.com\/t6oivhQt\/.*/
urlRegex: /https:\/\/btlr\.sharethrough\.com\/t6oivhQt\/.*/
};
}

Expand Down Expand Up @@ -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) {
Expand All @@ -68,7 +69,7 @@ function getValidResponse(request, creative) {
creatives: [
{
adm: creative,
cpm: 2,
cpm: 2
}
]
});
Expand Down
16 changes: 12 additions & 4 deletions share-through/share-through-htb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -160,6 +163,10 @@ function ShareThroughHtb(configs) {
}
}

function __getProtocol() {
return document.location.protocol;
}

/* =============================================================================
* STEP 5 | Rendering Pixel
* -----------------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -385,7 +392,8 @@ function ShareThroughHtb(configs) {
__baseClass = Partner(__profile, configs, null, {
parseResponse: __parseResponse,
generateRequestObj: __generateRequestObj,
b64EncodeUnicode: __b64EncodeUnicode
b64EncodeUnicode: __b64EncodeUnicode,
getProtocol: __getProtocol
});
})();

Expand Down

0 comments on commit d2461e5

Please sign in to comment.