Skip to content

Commit

Permalink
Fix bug in rubicon bid adapter for fpd keywords (#5078)
Browse files Browse the repository at this point in the history
Co-authored-by: rmartinez <Rachael24!>
  • Loading branch information
robertrmartinez authored Apr 6, 2020
1 parent 309c165 commit 59ccbbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/rubiconBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ export const spec = {
const keywords = (params.keywords || []).concat(
utils.deepAccess(config.getConfig('fpd.user'), 'keywords') || [],
utils.deepAccess(config.getConfig('fpd.context'), 'keywords') || []);
data.kw = keywords.length ? keywords.join(',') : '';
data.kw = Array.isArray(keywords) && keywords.length ? keywords.join(',') : '';

/**
* Prebid AdSlot
Expand Down
6 changes: 6 additions & 0 deletions test/spec/modules/rubiconBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,12 @@ describe('the rubicon adapter', function () {
}
});
});

it('should not fail if keywords param is not an array', function () {
bidderRequest.bids[0].params.keywords = 'a,b,c';
const slotParams = spec.createSlotParams(bidderRequest.bids[0], bidderRequest);
expect(slotParams.kw).to.equal('');
});
});

describe('hasVideoMediaType', function () {
Expand Down

0 comments on commit 59ccbbf

Please sign in to comment.