diff --git a/modules/gumgumBidAdapter.js b/modules/gumgumBidAdapter.js index 3a347163e6d..d071127f6b7 100644 --- a/modules/gumgumBidAdapter.js +++ b/modules/gumgumBidAdapter.js @@ -60,7 +60,7 @@ function _getBrowserParams(topWindowUrl) { pu: topUrl, ce: storage.cookiesAreEnabled(), dpr: topWindow.devicePixelRatio || 1, - jcsi: JSON.stringify({ t: 0, rq: 8 }), + jcsi: encodeURIComponent(JSON.stringify({ t: 0, rq: 8 })), ogu: getOgURL() } diff --git a/test/spec/modules/gumgumBidAdapter_spec.js b/test/spec/modules/gumgumBidAdapter_spec.js index 9073ad3bfda..a2fbc2cf029 100644 --- a/test/spec/modules/gumgumBidAdapter_spec.js +++ b/test/spec/modules/gumgumBidAdapter_spec.js @@ -228,6 +228,13 @@ describe('gumgumAdapter', function () { expect(bidRequest.data).to.not.include.any.keys('ns'); } }); + it('has jcsi param correctly encoded', function () { + const jcsi = JSON.stringify({ t: 0, rq: 8 }); + const encodedJCSI = encodeURIComponent(jcsi); + const bidRequest = spec.buildRequests(bidRequests)[0]; + expect(bidRequest.data.jcsi).to.not.contain(/\{.*\}/); + expect(bidRequest.data.jcsi).to.eq(encodedJCSI); + }); }) describe('interpretResponse', function () {