Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote sharethrough SSL update to production #179

Merged
merged 13 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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