diff --git a/modules/adnuntiusBidAdapter.js b/modules/adnuntiusBidAdapter.js index e013ed553ef..f05cd9f9f32 100644 --- a/modules/adnuntiusBidAdapter.js +++ b/modules/adnuntiusBidAdapter.js @@ -56,6 +56,8 @@ export const spec = { const requests = []; const request = []; const ortb2 = config.getConfig('ortb2'); + const bidderConfig = config.getConfig(); + const adnMeta = handleMeta() const usi = getUsi(adnMeta, ortb2, bidderRequest) const segments = getSegmentsFromOrtb(ortb2); @@ -68,7 +70,7 @@ export const spec = { if (gdprApplies !== undefined) request.push('consentString=' + consentString); if (segments.length > 0) request.push('segments=' + segments.join(',')); if (usi) request.push('userId=' + usi); - + if (bidderConfig.useCookie === false) request.push('noCookies=true') for (var i = 0; i < validBidRequests.length; i++) { const bid = validBidRequests[i] const network = bid.params.network || 'network'; diff --git a/test/spec/modules/adnuntiusBidAdapter_spec.js b/test/spec/modules/adnuntiusBidAdapter_spec.js index 20b035011fe..3b6ad8d0912 100644 --- a/test/spec/modules/adnuntiusBidAdapter_spec.js +++ b/test/spec/modules/adnuntiusBidAdapter_spec.js @@ -19,6 +19,7 @@ describe('adnuntiusBidAdapter', function () { }); const tzo = new Date().getTimezoneOffset(); const ENDPOINT_URL = `${URL}${tzo}&format=json&userId=${usi}`; + const ENDPOINT_URL_NOCOOKIE = `${URL}${tzo}&format=json&userId=${usi}&noCookies=true`; const ENDPOINT_URL_SEGMENTS = `${URL}${tzo}&format=json&segments=segment1,segment2,segment3&userId=${usi}`; const ENDPOINT_URL_CONSENT = `${URL}${tzo}&format=json&consentString=consentString&userId=${usi}`; const adapter = newBidder(spec); @@ -287,6 +288,22 @@ describe('adnuntiusBidAdapter', function () { }); }); + describe('use cookie', function () { + it('should send noCookie in url if set to false.', function () { + config.setBidderConfig({ + bidders: ['adnuntius'], + config: { + useCookie: false + } + }); + + const request = config.runWithBidder('adnuntius', () => spec.buildRequests(bidRequests)); + expect(request.length).to.equal(1); + expect(request[0]).to.have.property('url') + expect(request[0].url).to.equal(ENDPOINT_URL_NOCOOKIE); + }); + }); + describe('interpretResponse', function () { it('should return valid response when passed valid server response', function () { const interpretedResponse = spec.interpretResponse(serverResponse, singleBidRequest); diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index 93b863bf116..cb6adc8b745 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -198,8 +198,8 @@ describe('gumgumAdapter', function () { slotRequest.params.slot = invalidSlotId; legacySlotRequest.params.inSlot = invalidSlotId; - req = spec.buildRequests([ slotRequest ])[0]; - legReq = spec.buildRequests([ legacySlotRequest ])[0]; + req = spec.buildRequests([slotRequest])[0]; + legReq = spec.buildRequests([legacySlotRequest])[0]; expect(req.data.si).to.equal(invalidSlotId); expect(legReq.data.si).to.equal(invalidSlotId); @@ -696,7 +696,7 @@ describe('gumgumAdapter', function () { it('uses request size that nearest matches response size for in-screen', function () { const request = { ...bidRequest }; const body = { ...serverResponse }; - const expectedSize = [ 300, 50 ]; + const expectedSize = [300, 50]; let result; request.pi = 2;