Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonobi - Fixed issue where consent_string param could be set as undefined #2656

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4f9d0a5
added vp param to trinity request
JonGoSonobi Apr 25, 2018
d23114c
added lib_name and lib_v to trinity
JonGoSonobi Apr 26, 2018
ff5fabf
return null from buildRequests if there is no keymakers
JonGoSonobi Apr 26, 2018
ac246fd
added test case for empty keymaker
JonGoSonobi Apr 26, 2018
ef36be2
only importing functions we need from utils
JonGoSonobi Apr 26, 2018
85c9994
changed window.pbjs.version to use the gulp repalced macro .version$
JonGoSonobi Apr 27, 2018
17bb578
Merge branch 'master' into APEX-1472-vp
JonGoSonobi Apr 27, 2018
82909d2
resolved merge conflicts
JonGoSonobi Apr 27, 2018
6c3e3a8
fixed issue where isEmpty was being called from old utils var. Change…
JonGoSonobi Apr 27, 2018
cf45587
fixed lint issue
JonGoSonobi Apr 27, 2018
fd54c1d
resolved merge conflict
JonGoSonobi May 3, 2018
8898bf8
fixed issue where sonobi getUserSync was throwing an error on timeout
JonGoSonobi May 3, 2018
271e16d
sonobi support referrer param
JonGoSonobi May 4, 2018
7090d44
Merge branch 'master' into APEX-1516-user-sync-timeout-err
JonGoSonobi May 4, 2018
2f45786
fixed unit test for testing the ref param on bid request
JonGoSonobi May 4, 2018
ffe0932
return null from buildRequests if there is no keymakers
JonGoSonobi Apr 26, 2018
e0d53c1
fixed issue where isEmpty was being called from old utils var. Change…
JonGoSonobi Apr 27, 2018
4d7079a
Add gdpr support
bansawbanchee May 17, 2018
a55446c
resolved merge conflict
JonGoSonobi May 23, 2018
9bf2803
Merge branch 'master' of https://github.com/prebid/Prebid.js
JonGoSonobi May 25, 2018
8f04800
Merge branch 'master' of github.com:sonobi/Prebid.js
JonGoSonobi May 25, 2018
5124c39
Merge branch 'master' of https://github.com/prebid/Prebid.js
JonGoSonobi May 30, 2018
1ec4011
only sending consent string if it exists
JonGoSonobi May 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/sonobiBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ export const spec = {
// Apply GDPR parameters to request.
if (bidderRequest && bidderRequest.gdprConsent) {
payload.gdpr = bidderRequest.gdprConsent.gdprApplies ? 'true' : 'false';
payload.consent_string = bidderRequest.gdprConsent.consentString;
if (bidderRequest.gdprConsent.consentString) {
payload.consent_string = bidderRequest.gdprConsent.consentString;
}
}

// If there is no key_maker data, then don't make the request.
Expand Down
29 changes: 28 additions & 1 deletion test/spec/modules/sonobiBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,34 @@ describe('SonobiBidAdapter', () => {
expect(bidRequests.data.gdpr).to.equal('false')
expect(bidRequests.data.consent_string).to.equal('BOJ/P2HOJ/P2HABABMAAAAAZ+A==')
})

it('should return a properly formatted request with GDPR applies set to false with no consent_string param', () => {
let bidderRequests = {
'gdprConsent': {
'consentString': undefined,
'vendorData': {},
'gdprApplies': false
},
};
const bidRequests = spec.buildRequests(bidRequest, bidderRequests)
expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json')
expect(bidRequests.method).to.equal('GET')
expect(bidRequests.data.gdpr).to.equal('false')
expect(bidRequests.data).to.not.include.keys('consent_string')
})
it('should return a properly formatted request with GDPR applies set to true with no consent_string param', () => {
let bidderRequests = {
'gdprConsent': {
'consentString': undefined,
'vendorData': {},
'gdprApplies': true
},
};
const bidRequests = spec.buildRequests(bidRequest, bidderRequests)
expect(bidRequests.url).to.equal('https://apex.go.sonobi.com/trinity.json')
expect(bidRequests.method).to.equal('GET')
expect(bidRequests.data.gdpr).to.equal('true')
expect(bidRequests.data).to.not.include.keys('consent_string')
})
it('should return a properly formatted request with hfa', () => {
bidRequest[0].params.hfa = 'hfakey'
bidRequest[1].params.hfa = 'hfakey'
Expand Down