diff --git a/modules/ixBidAdapter.js b/modules/ixBidAdapter.js index 3384bb8f41b..f3ac8185f17 100644 --- a/modules/ixBidAdapter.js +++ b/modules/ixBidAdapter.js @@ -185,7 +185,8 @@ export const spec = { // If the bid request is for banner, then transform the bid request based on banner format. if (utils.deepAccess(validBidRequest, 'mediaTypes.banner') || - validBidRequest.mediaType === 'banner') { + validBidRequest.mediaType === 'banner' || + (validBidRequest.mediaType === undefined && utils.deepAccess(validBidRequest, 'mediaTypes.banner') === undefined)) { bannerImp = bidToBannerImp(validBidRequest); bannerImps.push(bannerImp); } diff --git a/test/spec/modules/ixBidAdapter_spec.js b/test/spec/modules/ixBidAdapter_spec.js index 0e00a64aab4..92a7190bcb6 100644 --- a/test/spec/modules/ixBidAdapter_spec.js +++ b/test/spec/modules/ixBidAdapter_spec.js @@ -272,6 +272,21 @@ describe('IndexexchangeAdapter', () => { expect(requestStringTimeout.data.t).to.be.undefined; }); + + it('should default to assuming media type is banner', () => { + const bidsWithoutMediaType = [ + Object.assign({}, DEFAULT_BANNER_VALID_BID[0]) + ]; + delete bidsWithoutMediaType[0].mediaTypes; + + const request = spec.buildRequests(bidsWithoutMediaType); + const payload = JSON.parse(request.data.r); + + expect(payload.id).to.equal(bidsWithoutMediaType[0].bidderRequestId); + expect(payload.imp).to.exist; + expect(payload.imp).to.be.an('array'); + expect(payload.imp).to.have.lengthOf(1); + }); }); describe('interpretResponseBanner', () => {