Skip to content

Commit af8fb38

Browse files
authored
OpenX handle response with missing seatbid and no nbr (#8999)
1 parent 8ebd8a4 commit af8fb38

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

modules/openxOrtbBidAdapter.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function interpretOrtbResponse(resp, req) {
275275
}
276276

277277
const respBody = resp.body;
278-
if (!respBody || 'nbr' in respBody) {
278+
if (!respBody || 'nbr' in respBody || !Array.isArray(respBody.seatbid)) {
279279
return [];
280280
}
281281

test/spec/modules/openxOrtbBidAdapter_spec.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,37 @@ describe('OpenxRtbAdapter', function () {
10191019
});
10201020
});
10211021

1022+
context('when no seatbid in response', function () {
1023+
let bids;
1024+
beforeEach(function () {
1025+
bidRequestConfigs = [{
1026+
bidder: 'openx',
1027+
params: {
1028+
unit: '12345678',
1029+
delDomain: 'test-del-domain'
1030+
},
1031+
adUnitCode: 'adunit-code',
1032+
mediaTypes: {
1033+
banner: {
1034+
sizes: [[300, 250], [300, 600]],
1035+
},
1036+
},
1037+
bidId: 'test-bid-id',
1038+
bidderRequestId: 'test-bidder-request-id',
1039+
auctionId: 'test-auction-id'
1040+
}];
1041+
1042+
bidRequest = spec.buildRequests(bidRequestConfigs, {refererInfo: {}})[0];
1043+
1044+
bidResponse = {ext: {}, id: 'test-bid-id'};
1045+
bids = spec.interpretResponse({body: bidResponse}, bidRequest);
1046+
});
1047+
1048+
it('should not return any bids', function () {
1049+
expect(bids.length).to.equal(0);
1050+
});
1051+
});
1052+
10221053
context('when there is no response', function () {
10231054
let bids;
10241055
beforeEach(function () {

0 commit comments

Comments
 (0)