Skip to content

Commit

Permalink
Pass uspConsent in bidRequest (#4675)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobkmiller authored and jsnellbaker committed Jan 2, 2020
1 parent 0b98025 commit f657ec5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/underdogmediaBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export const spec = {
}
}

if (bidderRequest.uspConsent) {
data.uspConsent = bidderRequest.uspConsent;
}

if (!data.gdprApplies || data.consentGiven) {
return {
method: 'GET',
Expand Down
13 changes: 13 additions & 0 deletions test/spec/modules/underdogmediaBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,19 @@ describe('UnderdogMedia adapter', function () {
expect(request.data.sizes).to.equal('300x250,728x90');
expect(request.data.sid).to.equal('12143');
});

it('should have uspConsent if defined', function () {
const uspConsent = '1YYN'
bidderRequest.uspConsent = uspConsent
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data.uspConsent).to.equal(uspConsent);
});

it('should not have uspConsent if not defined', function () {
bidderRequest.uspConsent = undefined
const request = spec.buildRequests(bidRequests, bidderRequest);
expect(request.data.uspConsent).to.be.undefined;
});
});

describe('bid responses', function () {
Expand Down

0 comments on commit f657ec5

Please sign in to comment.