Skip to content

Commit

Permalink
Add fallback logic to catch protocol of iframe when prebid does not r…
Browse files Browse the repository at this point in the history
…each window.top
  • Loading branch information
madma committed Dec 3, 2019
1 parent e429dfb commit 88d14bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/sharethroughBidAdapter.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { registerBidder } from '../src/adapters/bidderFactory';

const VERSION = '3.1.0';
const VERSION = '3.2.0';
const BIDDER_CODE = 'sharethrough';
const STR_ENDPOINT = 'https://btlr.sharethrough.com/WYu2BXv1/v1';
const DEFAULT_SIZE = [1, 1];
Expand Down Expand Up @@ -30,10 +30,13 @@ export const sharethroughAdapterSpec = {
};

let secure = false;
// https://prebid.org/dev-docs/bidder-adaptor.html#referrers
if (bidderRequest && bidderRequest.refererInfo && bidderRequest.refererInfo.referer) {
if (bidderRequest.refererInfo.referer.indexOf('http')) {
secure = bidderRequest.refererInfo.referer.indexOf('https');
}
} else if (bidderRequest && bidderRequest.refererInfo & !bidderRequest.refererInfo.reachedTop) {
secure = document.location.protocol.indexOf('http') && document.location.protocol.indexOf('https');
}

query.secure = secure;
Expand Down

0 comments on commit 88d14bf

Please sign in to comment.