-
Notifications
You must be signed in to change notification settings - Fork 224
MobileFuse Adapter: Remove tagid_src and pub_id params #3915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
76a61bb
9d48692
64b827f
695d694
2c22211
185fc06
3033451
9d59b8a
5d4c0d6
14153c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,17 +45,6 @@ public MobilefuseBidder(String endpointUrl, JacksonMapper mapper) { | |
|
|
||
| @Override | ||
| public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request) { | ||
| final String endpoint = request.getImp().stream() | ||
| .map(this::parseImpExt) | ||
| .filter(Objects::nonNull) | ||
| .findFirst() | ||
| .map(this::makeUrl) | ||
| .orElse(null); | ||
|
|
||
| if (endpoint == null) { | ||
| return Result.withError(BidderError.badInput("Invalid ExtImpMobilefuse value")); | ||
| } | ||
|
|
||
| final List<Imp> modifiedImps = request.getImp().stream() | ||
| .map(this::modifyImp) | ||
| .filter(Objects::nonNull) | ||
|
|
@@ -66,7 +55,7 @@ public Result<List<HttpRequest<BidRequest>>> makeHttpRequests(BidRequest request | |
| } | ||
|
|
||
| final BidRequest modifiedRequest = request.toBuilder().imp(modifiedImps).build(); | ||
| return Result.withValue(BidderUtil.defaultRequest(modifiedRequest, endpoint, mapper)); | ||
| return Result.withValue(BidderUtil.defaultRequest(modifiedRequest, endpointUrl, mapper)); | ||
| } | ||
|
|
||
| private Imp modifyImp(Imp imp) { | ||
|
|
@@ -75,6 +64,10 @@ private Imp modifyImp(Imp imp) { | |
| } | ||
|
|
||
| final ExtImpMobilefuse impExt = parseImpExt(imp); | ||
| if (impExt == null) { | ||
| return null; | ||
| } | ||
|
||
|
|
||
| final ObjectNode skadn = parseSkadn(imp.getExt()); | ||
| return imp.toBuilder() | ||
| .tagid(Objects.toString(impExt.getPlacementId(), "0")) | ||
|
|
@@ -98,11 +91,6 @@ private ObjectNode parseSkadn(ObjectNode impExt) { | |
| } | ||
| } | ||
|
|
||
| private String makeUrl(ExtImpMobilefuse extImp) { | ||
| final String baseUrl = endpointUrl + Objects.toString(extImp.getPublisherId(), "0"); | ||
| return "ext".equals(extImp.getTagidSrc()) ? baseUrl + "&tagid_src=ext" : baseUrl; | ||
| } | ||
|
|
||
| @Override | ||
| public final Result<List<BidderBid>> makeBids(BidderCall<BidRequest> httpCall, BidRequest bidRequest) { | ||
| try { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reorder the methods so that they are placed in the order they are called
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied both changes