Skip to content

Commit

Permalink
Qwarry Bid Adapter: add GDPR and consent string handling (#6489)
Browse files Browse the repository at this point in the history
* qwarry bid adapter

* formatting fixes

* fix tests for qwarry

* qwarry bid adapter

* add header for qwarry bid adapter

* bid requests fix

* fix tests

* response fix

* fix tests for Qwarry bid adapter

* add pos parameter to qwarry bid adapter

* qwarryBidAdapter onBidWon hotfix

* Change bidder endpoint url for Qwarry adapter

* add referer JS detection

* use bidderRequest.refererInfo

* fix tests

* GDPR consent string support

* NPE fix

Co-authored-by: Artem Kostritsa <akostritsa@akostritsa.com>
Co-authored-by: Alexander Kascheev <akascheev@asteriosoft.com>
Co-authored-by: pro-nsk <32703851+pro-nsk@users.noreply.github.com>
  • Loading branch information
4 people authored and idettman committed May 21, 2021
1 parent 416f992 commit 33d44d2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
29 changes: 22 additions & 7 deletions modules/qwarryBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,31 @@ export const spec = {
})
})

let payload = {
requestId: bidderRequest.bidderRequestId,
bids,
referer: bidderRequest.refererInfo.referer
}

if (bidderRequest && bidderRequest.gdprConsent) {
payload.gdprConsent = {
consentRequired: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : false,
consentString: bidderRequest.gdprConsent.consentString
}
}

const options = {
contentType: 'application/json',
customHeaders: {
'Rtb-Direct': true
}
}

return {
method: 'POST',
url: ENDPOINT,
data: { requestId: bidderRequest.bidderRequestId, bids, referer: bidderRequest.refererInfo.referer },
options: {
contentType: 'application/json',
customHeaders: {
'Rtb-Direct': true
}
}
data: payload,
options
};
},

Expand Down
11 changes: 10 additions & 1 deletion test/spec/modules/qwarryBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,16 @@ describe('qwarryBidAdapter', function () {

describe('buildRequests', function () {
let bidRequests = [REQUEST]
const bidderRequest = spec.buildRequests(bidRequests, { bidderRequestId: '123', refererInfo: { referer: 'http://test.com/path.html' } })
const bidderRequest = spec.buildRequests(bidRequests, {
bidderRequestId: '123',
gdprConsent: {
gdprApplies: true,
consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A=='
},
refererInfo: {
referer: 'http://test.com/path.html'
}
})

it('sends bid request to ENDPOINT via POST', function () {
expect(bidderRequest.method).to.equal('POST')
Expand Down

0 comments on commit 33d44d2

Please sign in to comment.