Skip to content

Commit

Permalink
modify ixBidAdapater to always use the secure endpoint (prebid#4323)
Browse files Browse the repository at this point in the history
  • Loading branch information
ix-prebid-support authored and sa1omon committed Nov 28, 2019
1 parent 8d9bcfd commit 171c5a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
10 changes: 1 addition & 9 deletions modules/ixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { registerBidder } from '../src/adapters/bidderFactory';

const BIDDER_CODE = 'ix';
const BANNER_SECURE_BID_URL = 'https://as-sec.casalemedia.com/cygnus';
const BANNER_INSECURE_BID_URL = 'http://as.casalemedia.com/cygnus';
const SUPPORTED_AD_TYPES = [BANNER];
const ENDPOINT_VERSION = 7.2;
const CENT_TO_DOLLAR_FACTOR = 100;
Expand Down Expand Up @@ -188,10 +187,7 @@ export const spec = {
let validBidRequest = null;
let bannerImp = null;

// Always start by assuming the protocol is HTTPS. This way, it will work
// whether the page protocol is HTTP or HTTPS. Then check if the page is
// actually HTTP.If we can guarantee it is, then, and only then, set protocol to
// HTTP.
// Always use secure HTTPS protocol.
let baseUrl = BANNER_SECURE_BID_URL;

for (let i = 0; i < validBidRequests.length; i++) {
Expand Down Expand Up @@ -258,10 +254,6 @@ export const spec = {

if (options.refererInfo) {
r.site.page = options.refererInfo.referer;

if (options.refererInfo.referer && options.refererInfo.referer.indexOf('https') !== 0) {
baseUrl = BANNER_INSECURE_BID_URL;
}
}
}

Expand Down
3 changes: 1 addition & 2 deletions test/spec/modules/ixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { newBidder } from 'src/adapters/bidderFactory';
import { spec } from 'modules/ixBidAdapter';

describe('IndexexchangeAdapter', function () {
const IX_INSECURE_ENDPOINT = 'http://as.casalemedia.com/cygnus';
const IX_SECURE_ENDPOINT = 'https://as-sec.casalemedia.com/cygnus';
const BIDDER_VERSION = 7.2;

Expand Down Expand Up @@ -401,7 +400,7 @@ describe('IndexexchangeAdapter', function () {

it('request should be made to IX endpoint with GET method', function () {
expect(requestMethod).to.equal('GET');
expect(requestUrl).to.equal(IX_INSECURE_ENDPOINT);
expect(requestUrl).to.equal(IX_SECURE_ENDPOINT);
});

it('query object (version, siteID and request) should be correct', function () {
Expand Down

0 comments on commit 171c5a2

Please sign in to comment.