Skip to content

Commit 1fae3c4

Browse files
artemiokostArtem KostritsaAlexander Kascheevpro-nsk
authored and
marc_tappx
committed
Qwarry Bid Adapter: add GDPR and consent string handling (prebid#6489)
* 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 <[email protected]> Co-authored-by: Alexander Kascheev <[email protected]> Co-authored-by: pro-nsk <[email protected]>
1 parent b87bfb1 commit 1fae3c4

File tree

2 files changed

+32
-8
lines changed

2 files changed

+32
-8
lines changed

modules/qwarryBidAdapter.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,31 @@ export const spec = {
2424
})
2525
})
2626

27+
let payload = {
28+
requestId: bidderRequest.bidderRequestId,
29+
bids,
30+
referer: bidderRequest.refererInfo.referer
31+
}
32+
33+
if (bidderRequest && bidderRequest.gdprConsent) {
34+
payload.gdprConsent = {
35+
consentRequired: (typeof bidderRequest.gdprConsent.gdprApplies === 'boolean') ? bidderRequest.gdprConsent.gdprApplies : false,
36+
consentString: bidderRequest.gdprConsent.consentString
37+
}
38+
}
39+
40+
const options = {
41+
contentType: 'application/json',
42+
customHeaders: {
43+
'Rtb-Direct': true
44+
}
45+
}
46+
2747
return {
2848
method: 'POST',
2949
url: ENDPOINT,
30-
data: { requestId: bidderRequest.bidderRequestId, bids, referer: bidderRequest.refererInfo.referer },
31-
options: {
32-
contentType: 'application/json',
33-
customHeaders: {
34-
'Rtb-Direct': true
35-
}
36-
}
50+
data: payload,
51+
options
3752
};
3853
},
3954

test/spec/modules/qwarryBidAdapter_spec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,16 @@ describe('qwarryBidAdapter', function () {
7070

7171
describe('buildRequests', function () {
7272
let bidRequests = [REQUEST]
73-
const bidderRequest = spec.buildRequests(bidRequests, { bidderRequestId: '123', refererInfo: { referer: 'http://test.com/path.html' } })
73+
const bidderRequest = spec.buildRequests(bidRequests, {
74+
bidderRequestId: '123',
75+
gdprConsent: {
76+
gdprApplies: true,
77+
consentString: 'BOJ8RZsOJ8RZsABAB8AAAAAZ+A=='
78+
},
79+
refererInfo: {
80+
referer: 'http://test.com/path.html'
81+
}
82+
})
7483

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

0 commit comments

Comments
 (0)