From a77ea2b21f54eeb1216d03755b551ac2daacd6ac Mon Sep 17 00:00:00 2001 From: rpanchyk Date: Mon, 26 Apr 2021 07:22:18 +0300 Subject: [PATCH] Update SmartyAds sync url and fix Decenterads imp.ext resolving --- .../bidder/decenterads/DecenteradsBidder.java | 16 ++++++++-------- src/main/resources/bidder-config/smartyads.yaml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/prebid/server/bidder/decenterads/DecenteradsBidder.java b/src/main/java/org/prebid/server/bidder/decenterads/DecenteradsBidder.java index c3c39d0379f..d1448734871 100644 --- a/src/main/java/org/prebid/server/bidder/decenterads/DecenteradsBidder.java +++ b/src/main/java/org/prebid/server/bidder/decenterads/DecenteradsBidder.java @@ -47,8 +47,8 @@ public Result>> makeHttpRequests(BidRequest request for (Imp imp : request.getImp()) { try { - final JsonNode resolvedImpExt = resolveImpExt(imp.getExt()); - final Imp updatedImp = updateImp(imp, resolvedImpExt); + final ObjectNode decenteradsImpExt = parseAndValidateImpExt(imp.getExt()); + final Imp updatedImp = updateImp(imp, decenteradsImpExt); validRequests.add(createRequest(request, updatedImp)); } catch (PreBidException e) { @@ -59,16 +59,16 @@ public Result>> makeHttpRequests(BidRequest request return Result.of(validRequests, errors); } - private static JsonNode resolveImpExt(ObjectNode impExt) { - final JsonNode newImExt = impExt.get("bidder"); - if (newImExt.isEmpty()) { + private static ObjectNode parseAndValidateImpExt(ObjectNode impExt) { + final JsonNode ext = impExt.get("bidder"); + if (ext.isEmpty() || !ext.isObject()) { throw new PreBidException("bidder parameters required"); } - return newImExt; + return (ObjectNode) ext; } - private static Imp updateImp(Imp imp, JsonNode newExt) { - return imp.toBuilder().ext(newExt.deepCopy()).build(); + private static Imp updateImp(Imp imp, ObjectNode impExt) { + return imp.toBuilder().ext(impExt).build(); } private HttpRequest createRequest(BidRequest request, Imp requestImp) { diff --git a/src/main/resources/bidder-config/smartyads.yaml b/src/main/resources/bidder-config/smartyads.yaml index 708db64c9bf..79f9317a892 100644 --- a/src/main/resources/bidder-config/smartyads.yaml +++ b/src/main/resources/bidder-config/smartyads.yaml @@ -20,8 +20,8 @@ adapters: supported-vendors: vendor-id: 0 usersync: - url: https://as.ck-ie.com/prebid.gif?gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&redir= - redirect-url: /setuid?bidder=smartyads&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&uid=[uid] + url: https://us.ck-ie.com/yhsfle286.gif?redir= + redirect-url: /setuid?bidder=smartyads&gdpr={{gdpr}}&gdpr_consent={{gdpr_consent}}&us_privacy={{us_privacy}}&uid={$PARTNER_UID} cookie-family-name: smartyads type: redirect support-cors: false