Skip to content

Commit

Permalink
Rubicon Adapter: Always make requests using HTTPS (prebid#4380)
Browse files Browse the repository at this point in the history
* Add microadBidAdapter

* Remove unnecessary encodeURIComponent from microadBidAdapter

* Submit Advangelists Prebid Adapter

* Submit Advangelists Prebid Adapter 1.1

* Correct procudtion endpoint for prebid

* analytics update with wrapper name

* reverted error merge

* update changed default value of netRevenue to true

* Always make bids requests using https

* rp_secure and imp.secure should always be 1
  • Loading branch information
msm0504 authored and sa1omon committed Nov 28, 2019
1 parent e221b51 commit d577822
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
14 changes: 5 additions & 9 deletions modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import {BANNER, VIDEO} from '../src/mediaTypes';

const DEFAULT_INTEGRATION = 'pbjs_lite';

function isSecure() {
return location.protocol === 'https:';
}

// use protocol relative urls for http or https
export const FASTLANE_ENDPOINT = '//fastlane.rubiconproject.com/a/api/fastlane.json';
export const VIDEO_ENDPOINT = '//prebid-server.rubiconproject.com/openrtb2/auction';
// always use https, regardless of whether or not current page is secure
export const FASTLANE_ENDPOINT = 'https://fastlane.rubiconproject.com/a/api/fastlane.json';
export const VIDEO_ENDPOINT = 'https://prebid-server.rubiconproject.com/openrtb2/auction';
export const SYNC_ENDPOINT = 'https://eus.rubiconproject.com/usync.html';

const DIGITRUST_PROP_NAMES = {
Expand Down Expand Up @@ -153,7 +149,7 @@ export const spec = {
imp: [{
exp: 300,
id: bidRequest.adUnitCode,
secure: isSecure() || bidRequest.params.secure ? 1 : 0,
secure: 1,
ext: {
rubicon: bidRequest.params
},
Expand Down Expand Up @@ -397,7 +393,7 @@ export const spec = {
'size_id': parsedSizes[0],
'alt_size_ids': parsedSizes.slice(1).join(',') || undefined,
'rp_floor': (params.floor = parseFloat(params.floor)) > 0.01 ? params.floor : 0.01,
'rp_secure': isSecure() ? '1' : '0',
'rp_secure': '1',
'tk_flint': `${configIntType || DEFAULT_INTEGRATION}_v$prebid.version$`,
'x_source.tid': bidRequest.transactionId,
'p_screen_res': _getScreenResolution(),
Expand Down
8 changes: 4 additions & 4 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ describe('the rubicon adapter', function () {
let [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
let data = parseQuery(request.data);

expect(request.url).to.equal('//fastlane.rubiconproject.com/a/api/fastlane.json');
expect(request.url).to.equal('https://fastlane.rubiconproject.com/a/api/fastlane.json');

let expectedQuery = {
'account_id': '14062',
Expand Down Expand Up @@ -454,7 +454,7 @@ describe('the rubicon adapter', function () {
let [request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
let data = parseQuery(request.data);

expect(request.url).to.equal('//fastlane.rubiconproject.com/a/api/fastlane.json');
expect(request.url).to.equal('https://fastlane.rubiconproject.com/a/api/fastlane.json');

// test that all values above are both present and correct
Object.keys(expectedQuery).forEach(key => {
Expand All @@ -470,7 +470,7 @@ describe('the rubicon adapter', function () {
[request] = spec.buildRequests(bidderRequest.bids, bidderRequest);
data = parseQuery(request.data);

expect(request.url).to.equal('//fastlane.rubiconproject.com/a/api/fastlane.json');
expect(request.url).to.equal('https://fastlane.rubiconproject.com/a/api/fastlane.json');

// test that all values above are both present and correct
Object.keys(expectedQuery).forEach(key => {
Expand Down Expand Up @@ -967,7 +967,7 @@ describe('the rubicon adapter', function () {
expect(item).to.have.property('bidRequest');

expect(item.method).to.equal('GET');
expect(item.url).to.equal('//fastlane.rubiconproject.com/a/api/fastlane.json');
expect(item.url).to.equal('https://fastlane.rubiconproject.com/a/api/fastlane.json');
expect(item.data).to.be.a('string');

// 'bidRequest' type must be 'array' if SRA enabled
Expand Down

0 comments on commit d577822

Please sign in to comment.