Skip to content

Commit

Permalink
Comments Fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoxaAntoxic committed Jan 4, 2024
1 parent 8f42d65 commit 1214612
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.prebid.server.auction.mediatypeprocessor;

import com.fasterxml.jackson.core.JsonPointer;
import com.fasterxml.jackson.databind.JsonNode;
import com.iab.openrtb.request.BidRequest;
import com.iab.openrtb.request.Imp;
Expand Down Expand Up @@ -35,6 +34,9 @@ public MediaTypeProcessingResult process(BidRequest bidRequest,
BidderAliases aliases,
Account account) {
final String resolvedBidderName = aliases.resolveBidder(bidderName);
//todo: ext.prebid.biddercontrols clean-up should NOT be here
// Suggestion: keep biddercontrols in the Auction Context
// and clean it up on the extraction auction participants step
final BidRequest.BidRequestBuilder bidRequestBuilder = Optional.ofNullable(bidRequest.getExt())
.map(ExtRequest::getPrebid)
.map(prebid -> prebid.toBuilder().biddercontrols(null).build())
Expand Down Expand Up @@ -79,7 +81,8 @@ private MediaType preferredMediaType(BidRequest bidRequest,
return Optional.ofNullable(bidRequest.getExt())
.map(ExtRequest::getPrebid)
.map(ExtRequestPrebid::getBiddercontrols)
.map(bidders -> bidders.at(JsonPointer.compile("/" + originalBidderName + "/" + PREF_MTYPE_FIELD)))
.map(bidders -> bidders.get(originalBidderName))
.map(bidder -> bidder.get(PREF_MTYPE_FIELD))
.filter(JsonNode::isTextual)
.map(JsonNode::textValue)
.map(MediaType::of)
Expand Down

0 comments on commit 1214612

Please sign in to comment.