Skip to content

Commit

Permalink
ZetaGlobalSsp BidAdapter: shortname to url (#8471)
Browse files Browse the repository at this point in the history
* ZetaGlobalSsp bid adapter: shortname param into url param

* fix tests

Co-authored-by: Surovenko Alexey <surovenko.alexey@gmail.com>
  • Loading branch information
asurovenko-zeta and surovenko committed May 27, 2022
1 parent 8702ee5 commit 8976ebc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions modules/zeta_global_sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export const spec = {
user: params.user ? params.user : {},
app: params.app ? params.app : {},
ext: {
tags: {...params.tags, shortname: params.shortname},
tags: params.tags ? params.tags : {},
sid: params.sid ? params.sid : undefined
}
};
Expand All @@ -126,9 +126,10 @@ export const spec = {
}

provideEids(request, payload);
const url = params.shortname ? ENDPOINT_URL.concat('?shortname=', params.shortname) : ENDPOINT_URL;
return {
method: 'POST',
url: ENDPOINT_URL,
url: url,
data: JSON.stringify(payload),
};
},
Expand Down
6 changes: 4 additions & 2 deletions test/spec/modules/zeta_global_sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,18 @@ describe('Zeta Ssp Bid Adapter', function () {
it('Test required params in banner request', function () {
const request = spec.buildRequests(bannerRequest, bannerRequest[0]);
const payload = JSON.parse(request.data);
expect(request.url).to.eql('https://ssp.disqus.com/bid?shortname=test_shortname');
expect(payload.ext.sid).to.eql('publisherId');
expect(payload.ext.tags.someTag).to.eql(444);
expect(payload.ext.tags.shortname).to.eql('test_shortname');
expect(payload.ext.tags.shortname).to.be.undefined;
});

it('Test required params in video request', function () {
const request = spec.buildRequests(videoRequest, videoRequest[0]);
const payload = JSON.parse(request.data);
expect(request.url).to.eql('https://ssp.disqus.com/bid?shortname=test_shortname');
expect(payload.ext.sid).to.eql('publisherId');
expect(payload.ext.tags.someTag).to.eql(444);
expect(payload.ext.tags.shortname).to.eql('test_shortname');
expect(payload.ext.tags.shortname).to.be.undefined;
});
});

0 comments on commit 8976ebc

Please sign in to comment.