Skip to content

Commit

Permalink
Omit app and device if not present rather than send false (#2116)
Browse files Browse the repository at this point in the history
* omit app and device if not present rather than send false

* no bang bang!  just get and set on request if object
  • Loading branch information
snapwich authored and matthewlane committed Feb 7, 2018
1 parent c053d04 commit 77fd5d2
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions modules/prebidServerBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,6 @@ export function PrebidServer() {
/* Prebid executes this function when the page asks to send out bid requests */
baseAdapter.callBids = function(s2sBidRequest, bidRequests, addBidResponse, done, ajax) {
const isDebug = !!getConfig('debug');
const app = !!getConfig('app');
const device = !!getConfig('device');
const adUnits = utils.deepClone(s2sBidRequest.ad_units);
adUnits.forEach(adUnit => {
let videoMediaType = utils.deepAccess(adUnit, 'mediaTypes.video');
Expand All @@ -234,13 +232,19 @@ export function PrebidServer() {
url: utils.getTopWindowUrl(),
prebid_version: '$prebid.version$',
ad_units: adUnits.filter(hasSizes),
is_debug: isDebug,
device: device,
app: app
is_debug: isDebug
};

let digiTrust = _getDigiTrustQueryParams();

// grab some global config and pass it along
['app', 'device'].forEach(setting => {
let value = getConfig(setting);
if (typeof value === 'object') {
requestJson[setting] = value;
}
});

if (digiTrust) {
requestJson.digiTrust = digiTrust;
}
Expand Down

0 comments on commit 77fd5d2

Please sign in to comment.