Skip to content

Commit

Permalink
Set a copy of imp.ext.context to each bidder imp (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
BraslavskiyAndrey authored Sep 8, 2020
1 parent 6b16f93 commit c9546cd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/prebid/server/auction/ExchangeService.java
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,13 @@ private ObjectNode prepareImpExt(String bidder, ObjectNode impExt, boolean useFi
final ObjectNode result = mapper.mapper().valueToTree(ExtPrebid.of(impExtPrebid, impExt.get(bidder)));

final JsonNode contextNode = impExt.get(CONTEXT_EXT);
if (contextNode != null && !contextNode.isNull()) {
if (!useFirstPartyData && contextNode.isObject()) {
((ObjectNode) contextNode).remove(DATA);
final boolean isContextNodePresent = contextNode != null && !contextNode.isNull();
if (isContextNodePresent) {
final JsonNode contextNodeCopy = contextNode.deepCopy();
if (!useFirstPartyData && contextNodeCopy.isObject()) {
((ObjectNode) contextNodeCopy).remove(DATA);
}
result.set(CONTEXT_EXT, contextNode);
result.set(CONTEXT_EXT, contextNodeCopy);
}
return result;
}
Expand Down

0 comments on commit c9546cd

Please sign in to comment.