Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class AdkernelBidder implements Bidder<BidRequest> {
new TypeReference<>() {
};

private static final String ZONE_ID_MACRO = "ZoneId";
private static final String MF_SUFFIX = "__mf";
private static final String MF_SUFFIX_BANNER = "b" + MF_SUFFIX;
private static final String MF_SUFFIX_VIDEO = "v" + MF_SUFFIX;
Expand Down Expand Up @@ -184,7 +185,7 @@ private HttpRequest<BidRequest> createHttpRequest(Map.Entry<ExtImpAdkernel, List
App app) {

final ExtImpAdkernel impExt = extAndImp.getKey();
final String uri = endpoint.replaceMacro("ZoneId", Objects.toString(impExt.getZoneId())).expand();
final String uri = endpoint.replaceMacro(ZONE_ID_MACRO, Objects.toString(impExt.getZoneId())).expand();

final MultiMap headers = HttpUtil.headers()
.add(HttpUtil.X_OPENRTB_VERSION_HEADER, "2.5");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.iab.openrtb.response.BidResponse;
import com.iab.openrtb.response.SeatBid;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.prebid.server.bidder.Bidder;
import org.prebid.server.bidder.model.BidderBid;
import org.prebid.server.bidder.model.BidderCall;
Expand Down Expand Up @@ -94,7 +95,11 @@ private String resolveUrl(ExtImpTappx extImpTappx, Integer test) {

return endpoint
.replaceMacro(SUBDOMAIN_MACRO, subdomain)
.replaceMacro(PATH_MACRO, isNewEndpoint ? List.of("rtb") : List.of("rtb", "v2", subdomainPart))
.replaceMacro(
PATH_MACRO,
isNewEndpoint
? List.of("rtb", StringUtils.EMPTY)
: List.of("rtb", "v2", subdomainPart))
.addQueryParam("tappxkey", extImpTappx.getTappxkey())
.addQueryParam("v", VERSION)
.addQueryParam("type_cnn", TYPE_CNN)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/bidder-config/adkernel.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
adapters:
adkernel:
endpoint: http://pbs.adksrv.com/hb?zone={Zone}
endpoint: http://pbs.adksrv.com/hb?zone={ZoneId}
endpoint-compression: gzip
aliases:
rxnetwork: ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public void makeHttpRequestShouldBuildCorrectUriWithEndPointParameterIfMatched()
// then
assertThat(result.getErrors()).isEmpty();
final String expectedUri =
"https://zz855226test.pub.domain/rtb?tappxkey=tappxkey&v=1.6&type_cnn=prebid";
"https://zz855226test.pub.domain/rtb/?tappxkey=tappxkey&v=1.6&type_cnn=prebid";
assertThat(result.getValue()).hasSize(1)
.allSatisfy(httpRequest -> {
assertThat(httpRequest.getUri()).isEqualTo(expectedUri);
Expand Down
Loading