Skip to content

Commit

Permalink
GumGum: uses encodeURIComponent inline (#5124)
Browse files Browse the repository at this point in the history
* uses encodeURIComponent inline

* adds test for jcsi param
  • Loading branch information
susyt authored Apr 17, 2020
1 parent a213fa0 commit 250dd1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/gumgumBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
7 changes: 7 additions & 0 deletions test/spec/modules/gumgumBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 250dd1d

Please sign in to comment.