Skip to content

Commit

Permalink
removing cookieSet (#3175)
Browse files Browse the repository at this point in the history
* removing cookieSet

* removing blank line

* not including src/cookie anymore
  • Loading branch information
bretg authored and jsnellbaker committed Oct 16, 2018
1 parent de597ae commit 1cdf418
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 51 deletions.
2 changes: 0 additions & 2 deletions modules/prebidServerBidAdapter/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
export const S2S_VENDORS = {
'appnexus': {
adapter: 'prebidServer',
cookieSet: false,
enabled: true,
endpoint: '//prebid.adnxs.com/pbs/v1/openrtb2/auction',
syncEndpoint: '//prebid.adnxs.com/pbs/v1/cookie_sync',
timeout: 1000
},
'rubicon': {
adapter: 'prebidServer',
cookieSet: false,
enabled: true,
endpoint: '//prebid-server.rubiconproject.com/openrtb2/auction',
syncEndpoint: '//prebid-server.rubiconproject.com/cookie_sync',
Expand Down
7 changes: 0 additions & 7 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import bidfactory from 'src/bidfactory';
import * as utils from 'src/utils';
import { ajax } from 'src/ajax';
import { STATUS, S2S, EVENTS } from 'src/constants';
import { cookieSet } from 'src/cookie.js';
import adaptermanager from 'src/adaptermanager';
import { config } from 'src/config';
import { VIDEO } from 'src/mediaTypes';
Expand Down Expand Up @@ -44,7 +43,6 @@ config.setDefaults({
* @property {boolean} [cacheMarkup] whether to cache the adm result
* @property {string} [adapter] adapter code to use for S2S
* @property {string} [syncEndpoint] endpoint URL for syncing cookies
* @property {string} [cookieSetUrl] url for cookie set library, if passed then cookieSet is enabled
*/
function setS2sConfig(options) {
if (options.defaultVendor) {
Expand Down Expand Up @@ -620,11 +618,6 @@ export function PrebidServer() {
});

bidderRequests.forEach(bidderRequest => events.emit(EVENTS.BIDDER_DONE, bidderRequest));

if (result.status === 'no_cookie' && _s2sConfig.cookieSet && typeof _s2sConfig.cookieSetUrl === 'string') {
// cookie sync
cookieSet(_s2sConfig.cookieSetUrl);
}
} catch (error) {
utils.logError(error);
}
Expand Down
11 changes: 0 additions & 11 deletions src/cookie.js

This file was deleted.

31 changes: 0 additions & 31 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { expect } from 'chai';
import { PrebidServer as Adapter, resetSyncedStatus } from 'modules/prebidServerBidAdapter/index.js';
import adapterManager from 'src/adaptermanager';
import * as utils from 'src/utils';
import cookie from 'src/cookie';
import { userSync } from 'src/userSync';
import { ajax } from 'src/ajax';
import { config } from 'src/config';
Expand Down Expand Up @@ -723,7 +722,6 @@ describe('S2S Adapter', function () {
sinon.stub(utils, 'triggerPixel');
sinon.stub(utils, 'insertUserSyncIframe');
sinon.stub(utils, 'logError');
sinon.stub(cookie, 'cookieSet');
sinon.stub(events, 'emit');
logWarnSpy = sinon.spy(utils, 'logWarn');
});
Expand All @@ -734,7 +732,6 @@ describe('S2S Adapter', function () {
utils.insertUserSyncIframe.restore();
utils.logError.restore();
events.emit.restore();
cookie.cookieSet.restore();
logWarnSpy.restore();
});

Expand Down Expand Up @@ -907,30 +904,6 @@ describe('S2S Adapter', function () {
expect(bid_request_passed).to.have.property('adId', '123');
});

it('does not call cookieSet cookie sync when no_cookie response && not opted in', function () {
server.respondWith(JSON.stringify(RESPONSE_NO_PBS_COOKIE));

let myConfig = Object.assign({}, CONFIG);

config.setConfig({s2sConfig: myConfig});
adapter.callBids(REQUEST, BID_REQUESTS, addBidResponse, done, ajax);
server.respond();
sinon.assert.notCalled(cookie.cookieSet);
});

it('calls cookieSet cookie sync when no_cookie response && opted in', function () {
server.respondWith(JSON.stringify(RESPONSE_NO_PBS_COOKIE));
let myConfig = Object.assign({
cookieSet: true,
cookieSetUrl: 'https://acdn.adnxs.com/cookieset/cs.js'
}, CONFIG);

config.setConfig({s2sConfig: myConfig});
adapter.callBids(REQUEST, BID_REQUESTS, addBidResponse, done, ajax);
server.respond();
sinon.assert.calledOnce(cookie.cookieSet);
});

it('handles OpenRTB responses and call BIDDER_DONE', function () {
const s2sConfig = Object.assign({}, CONFIG, {
endpoint: 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction'
Expand Down Expand Up @@ -1070,8 +1043,6 @@ describe('S2S Adapter', function () {
expect(vendorConfig).to.have.property('accountId', '123');
expect(vendorConfig).to.have.property('adapter', 'prebidServer');
expect(vendorConfig.bidders).to.deep.equal(['appnexus']);
expect(vendorConfig.cookieSet).to.be.false;
expect(vendorConfig.cookieSetUrl).to.be.undefined;
expect(vendorConfig.enabled).to.be.true;
expect(vendorConfig).to.have.property('endpoint', '//prebid.adnxs.com/pbs/v1/openrtb2/auction');
expect(vendorConfig).to.have.property('syncEndpoint', '//prebid.adnxs.com/pbs/v1/cookie_sync');
Expand All @@ -1093,8 +1064,6 @@ describe('S2S Adapter', function () {
expect(vendorConfig).to.have.property('accountId', 'abc');
expect(vendorConfig).to.have.property('adapter', 'prebidServer');
expect(vendorConfig.bidders).to.deep.equal(['rubicon']);
expect(vendorConfig.cookieSet).to.be.false;
expect(vendorConfig.cookieSetUrl).to.be.undefined;
expect(vendorConfig.enabled).to.be.true;
expect(vendorConfig).to.have.property('endpoint', '//prebid-server.rubiconproject.com/openrtb2/auction');
expect(vendorConfig).to.have.property('syncEndpoint', '//prebid-server.rubiconproject.com/cookie_sync');
Expand Down

0 comments on commit 1cdf418

Please sign in to comment.