Skip to content

Commit

Permalink
Freewheel SSP Bid Adapter: bugfix for schain (prebid#9492)
Browse files Browse the repository at this point in the history
* freewheel-sspBidAdapter: Bug Fix for schain (prebid#9471)
    * Fixed schain logic to parse schain as string
    * Updated schain test to check schain string

* Update freewheel-sspBidAdapter.js

* kickoff tests

---------

Co-authored-by: Scott Floam <sfloam@freewheel.tv>
Co-authored-by: Patrick McCann <pmccann@cafemedia.com>
Co-authored-by: Chris Huie <phoenixtechnerd@gmail.com>
  • Loading branch information
4 people authored and JacobKlein26 committed Feb 8, 2023
1 parent cee9e0f commit 044cf7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion modules/freewheel-sspBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,11 @@ export const spec = {
// Add schain object
var schain = currentBidRequest.schain;
if (schain) {
requestParams.schain = schain;
try {
requestParams.schain = JSON.stringify(schain);
} catch (error) {
logWarn('PREBID - ' + BIDDER_CODE + ': Unable to stringify the schain: ' + error);
}
}

var vastParams = currentBidRequest.params.vastUrlParams;
Expand Down
2 changes: 1 addition & 1 deletion test/spec/modules/freewheel-sspBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('freewheelSSP BidAdapter Test', () => {
it('should return a properly formatted request with schain defined', function () {
const request = spec.buildRequests(bidRequests);
const payload = request[0].data;
expect(payload.schain).to.deep.equal(bidRequests[0].schain)
expect(payload.schain).to.deep.equal('{\"ver\":\"1.0\",\"complete\":1,\"nodes\":[{\"asi\":\"example.com\",\"sid\":\"0\",\"hp\":1,\"rid\":\"bidrequestid\",\"domain\":\"example.com\"}]}');
});

it('sends bid request to ENDPOINT via GET', () => {
Expand Down

0 comments on commit 044cf7e

Please sign in to comment.