Skip to content

Commit

Permalink
DistrictmDMX: adding support for schain and remove content type to de…
Browse files Browse the repository at this point in the history
…fault to prebid selection (prebid#4366)

* adding DMX

test @97%, two files added one updated

* Update districtm_spec.js

* Update districtmDMX.js

* adding all districtm needed file

* remove legacy file

* remove typo || 0 in the test method

* force default to return a valid width and height

* update unit test code for failing test

* changed class for an object

* remove package-lock.json

* change file name for dmx adapter

* renamed files

* restaure package-lock.json

* update to last package-lock state

* update gdpr user consent

* fix sizes issue

* Documentation updates

Adding the readme.md info

* update file name and update unit testing import file location

* current machine state

* lint correction

* remove variable assigment duplicate
  • Loading branch information
stevealliance authored and tadam75 committed Jan 9, 2020
1 parent 0d7d070 commit 241ddd0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/districtmDMXBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const spec = {
},
buildRequests(bidRequest, bidderRequest) {
let timeout = config.getConfig('bidderTimeout');
let schain = null;
let dmxRequest = {
id: utils.generateUUID(),
cur: ['USD'],
Expand All @@ -80,6 +81,12 @@ export const spec = {
dmxRequest.user.ext = {};
dmxRequest.user.ext.consent = bidderRequest.gdprConsent.consentString;
}
try {
schain = bidRequest[0].schain;
dmxRequest.source = {};
dmxRequest.source.ext = {};
dmxRequest.source.ext.schain = schain || {}
} catch (e) {}
let tosendtags = bidRequest.map(dmx => {
var obj = {};
obj.id = dmx.bidId;
Expand All @@ -96,14 +103,11 @@ export const spec = {
return obj;
});
dmxRequest.imp = tosendtags;

return {
method: 'POST',
url: DMXURI,
data: JSON.stringify(dmxRequest),
options: {
contentType: 'application/json',
withCredentials: true
},
bidderRequest
}
},
Expand Down

0 comments on commit 241ddd0

Please sign in to comment.