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

Revert "don't allow null or undefined bid properties" #2886

Merged
merged 2 commits into from
Jul 24, 2018
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
2 changes: 1 addition & 1 deletion src/adapters/bidderFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function validBidSize(adUnitCode, bid, bidRequests) {
export function isValid(adUnitCode, bid, bidRequests) {
function hasValidKeys() {
let bidKeys = Object.keys(bid);
return COMMON_BID_RESPONSE_KEYS.every(key => includes(bidKeys, key) && !includes([undefined, null], bid[key]));
return COMMON_BID_RESPONSE_KEYS.every(key => includes(bidKeys, key));
}

function errorMessage(msg) {
Expand Down
30 changes: 0 additions & 30 deletions test/spec/unit/core/bidderFactory_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,36 +427,6 @@ describe('bidders created by newBidder', () => {

expect(logErrorSpy.calledOnce).to.equal(true);
});

it('should logError when required bid response params are undefined', () => {
const bidder = newBidder(spec);

const bid = {
'ad': 'creative',
'cpm': '1.99',
'width': 300,
'height': 250,
'requestId': '1',
'creativeId': 'some-id',
'currency': undefined,
'netRevenue': true,
'ttl': 360
};

spec.isBidRequestValid.returns(true);
spec.buildRequests.returns({
method: 'POST',
url: 'test.url.com',
data: {}
});
spec.getUserSyncs.returns([]);

spec.interpretResponse.returns(bid);

bidder.callBids(MOCK_BIDS_REQUEST, addBidResponseStub, doneStub, ajaxStub);

expect(logErrorSpy.calledOnce).to.equal(true);
});
});

describe('when the ajax call fails', () => {
Expand Down