Skip to content

Commit

Permalink
encode the 33across fp query parameter (prebid#11342)
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosfelix authored and mefjush committed Apr 25, 2024
1 parent 269437b commit 6e0801f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/33acrossIdSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function calculateQueryStringParams(pid, gdprConsentData, storageConfig) {

const fp = getStoredValue(STORAGE_FPID_KEY, storageConfig);
if (fp) {
params.fp = fp;
params.fp = encodeURIComponent(fp);
}

return params;
Expand Down
6 changes: 3 additions & 3 deletions test/spec/modules/33acrossIdSystem_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ describe('33acrossIdSystem', () => {
});

context('when a first-party ID is present in local storage', () => {
it('should call endpoint with the first-party ID included', () => {
it('should call endpoint with the encoded first-party ID included', () => {
const completeCallback = () => {};
const { callback } = thirthyThreeAcrossIdSubmodule.getId({
params: {
Expand All @@ -506,13 +506,13 @@ describe('33acrossIdSystem', () => {

sinon.stub(storage, 'getDataFromLocalStorage')
.withArgs('33acrossIdFp')
.returns('33acrossIdFpValue');
.returns('33acrossIdFpValue+');

callback(completeCallback);

const [request] = server.requests;

expect(request.url).to.contain('fp=33acrossIdFpValue');
expect(request.url).to.contain('fp=33acrossIdFpValue%2B');

storage.getDataFromLocalStorage.restore();
});
Expand Down

0 comments on commit 6e0801f

Please sign in to comment.