Skip to content

Commit

Permalink
Revert "added cur to ortb"
Browse files Browse the repository at this point in the history
This reverts commit 7b70c14.
  • Loading branch information
Isaac Dettman committed Jun 27, 2019
1 parent 7b70c14 commit 99a165a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 38 deletions.
8 changes: 0 additions & 8 deletions modules/prebidServerBidAdapter/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,14 +523,6 @@ const OPEN_RTB_PROTOCOL = {
request.ext.prebid = Object.assign(request.ext.prebid, _s2sConfig.extPrebid);
}

/**
* @type {(string[]|undefined)} - OpenRTB property 'cur', currencies available for bids
*/
const adServerCur = config.getConfig('currency.adServerCurrency');
if (Array.isArray(adServerCur) && adServerCur.length) {
request.cur = adServerCur.slice();
}

_appendSiteAppDevice(request);

const digiTrust = _getDigiTrustQueryParams(bidRequests && bidRequests[0]);
Expand Down
31 changes: 1 addition & 30 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,36 +831,7 @@ describe('S2S Adapter', function () {
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'adserver.org')[0].uids[0].id).is.equal('abc123');
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'pubcommon')).is.not.empty; ;
expect(requestBid.user.ext.eids.filter(eid => eid.source === 'pubcommon')[0].uids[0].id).is.equal('1234');
});

it('setting currency.adServerCurrency results in the openRTB JSON containing cur: ["AAA"]', function () {
let ortb2Config = utils.deepClone(CONFIG);
ortb2Config.endpoint = 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction';
config.setConfig({
currency: {adServerCurrency: ['USD', 'GB', 'UK', 'AU']},
s2sConfig: ortb2Config
});

const userIdBidRequest = utils.deepClone(BID_REQUESTS);
adapter.callBids(REQUEST, userIdBidRequest, addBidResponse, done, ajax);

const parsedRequestBody = JSON.parse(requests[0].requestBody);
expect(parsedRequestBody.cur).to.deep.equal(['USD', 'GB', 'UK', 'AU']);
});

it('when currency.adServerCurrency is unset, the OpenRTB JSON should not contain cur', function () {
let ortb2Config = utils.deepClone(CONFIG);
ortb2Config.endpoint = 'https://prebid.adnxs.com/pbs/v1/openrtb2/auction';
config.setConfig({
s2sConfig: ortb2Config
});

const userIdBidRequest = utils.deepClone(BID_REQUESTS);
adapter.callBids(REQUEST, userIdBidRequest, addBidResponse, done, ajax);

const parsedRequestBody = JSON.parse(requests[0].requestBody);
expect(typeof parsedRequestBody.cur).to.equal('undefined');
});
})

it('always add ext.prebid.targeting.includebidderkeys: false for ORTB', function () {
const s2sConfig = Object.assign({}, CONFIG, {
Expand Down

0 comments on commit 99a165a

Please sign in to comment.