Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connatix Bid Adapter: fix bidder name check #12157

Merged
merged 2 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions modules/connatixBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,17 @@ export const spec = {
const bidId = deepAccess(bid, 'bidId');
const mediaTypes = deepAccess(bid, 'mediaTypes', {});
const params = deepAccess(bid, 'params', {});
const bidder = deepAccess(bid, 'bidder');

const hasBidId = Boolean(bidId);
const isValidBidder = (bidder === BIDDER_CODE);
const hasMediaTypes = Boolean(mediaTypes) && (Boolean(mediaTypes[BANNER]) || Boolean(mediaTypes[VIDEO]));
const isValidBanner = validateBanner(mediaTypes);
const isValidVideo = validateVideo(mediaTypes);
const hasRequiredBidParams = Boolean(params.placementId);

const isValid = isValidBidder && hasBidId && hasMediaTypes && isValidBanner && isValidVideo && hasRequiredBidParams;
const isValid = hasBidId && hasMediaTypes && isValidBanner && isValidVideo && hasRequiredBidParams;
if (!isValid) {
logError(
`Invalid bid request:
isValidBidder: ${isValidBidder},
`Invalid bid request:
hasBidId: ${hasBidId},
hasMediaTypes: ${hasMediaTypes},
isValidBanner: ${isValidBanner},
Expand Down
4 changes: 0 additions & 4 deletions test/spec/modules/connatixBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ describe('connatixBidAdapter', function () {
it('Should return true if all required fileds are present', function () {
expect(spec.isBidRequestValid(bid)).to.be.true;
});
it('Should return false if bidder does not correspond', function () {
bid.bidder = 'abc';
expect(spec.isBidRequestValid(bid)).to.be.false;
});
it('Should return false if bidId is missing', function () {
delete bid.bidId;
expect(spec.isBidRequestValid(bid)).to.be.false;
Expand Down