Skip to content

Comments

Prebid 11: toss mediatype mismatch bids; avoid mediaType mismatch rejects when adapter omits mediaType#14496

Open
patmmccann wants to merge 1 commit intoprebid-11.0from
codex/redo-pr-14468-in-11-branch
Open

Prebid 11: toss mediatype mismatch bids; avoid mediaType mismatch rejects when adapter omits mediaType#14496
patmmccann wants to merge 1 commit intoprebid-11.0from
codex/redo-pr-14468-in-11-branch

Conversation

@patmmccann
Copy link
Collaborator

@patmmccann patmmccann commented Feb 20, 2026

redoes #14468 on the 11 branch as review indicated it might be breaking

Motivation

  • Prevent adapters that intentionally omit mediaType from having their bids rejected due to createBid() defaulting mediaType to 'banner'.
  • Backport the media-type enforcement from the referenced change to the 11 branch while addressing the review comment that the guard should be skipped when the adapter did not explicitly set mediaType.

Description

  • Add an explicit responseMediaType parameter propagated via addBidWithCode() into isValid() so the code can distinguish an adapter-omitted mediaType from an explicit one.
  • Preserve whether the adapter response contained mediaType by passing null when mediaType is not an own property of the adapter response; only enforce the ad-unit vs response media-type guard when responseMediaType is non-null.
  • Update isValid() signature to accept {responseMediaType} and run the media-type compatibility check against the ad unit only when responseMediaType != null.
  • Add unit tests in test/spec/unit/core/bidderFactory_spec.js that cover rejecting explicit mismatches, accepting explicit matches, and skipping the guard when the adapter omitted mediaType.

Testing

  • Lint run with npx eslint --cache --cache-strategy content and npx gulp lint --files 'src/adapters/bidderFactory.ts,test/spec/unit/core/bidderFactory_spec.js' completed successfully.
  • Unit test run npx gulp test --nolint --file test/spec/unit/core/bidderFactory_spec.js completed successfully (tests passed).
  • The changes are limited to src/adapters/bidderFactory.ts and test/spec/unit/core/bidderFactory_spec.js and the updated tests validate the new behavior.

Codex Task

@patmmccann patmmccann changed the title Core: avoid mediaType mismatch rejects when adapter omits mediaType Prebid 11: avoid mediaType mismatch rejects when adapter omits mediaType Feb 20, 2026
@patmmccann patmmccann changed the title Prebid 11: avoid mediaType mismatch rejects when adapter omits mediaType Prebid 11: toss mediatype mismatch bids; avoid mediaType mismatch rejects when adapter omits mediaType Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant