Skip to content

Commit d067a05

Browse files
committed
move apiContact logic
1 parent a973683 commit d067a05

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

src/main/java/com/uid2/operator/vertx/ClientVersionCapturingHandler.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,18 @@ public void handle(RoutingContext context) {
4545
clientVersion = !context.queryParam("client").isEmpty() ? context.queryParam("client").get(0) : null;
4646
}
4747
String apiContact;
48-
try {
49-
final String authHeaderValue = context.request().getHeader("Authorization");
50-
final String authKey = extractBearerToken(authHeaderValue);
51-
final IAuthorizable profile = this.authKeyStore.get(authKey);
52-
apiContact = profile.getContact();
53-
apiContact = apiContact == null ? "unknown" : apiContact;
54-
} catch (Exception ex) {
55-
apiContact = !context.queryParam("apiContact").isEmpty() ? context.queryParam("apiContact").get(0) : "unknown";
48+
// remove in UID2-4990
49+
apiContact = !context.queryParam("apiContact").isEmpty() ? context.queryParam("apiContact").get(0) : null;
50+
if (apiContact == null) {
51+
try {
52+
final String authHeaderValue = context.request().getHeader("Authorization");
53+
final String authKey = extractBearerToken(authHeaderValue);
54+
final IAuthorizable profile = this.authKeyStore.get(authKey);
55+
apiContact = profile.getContact();
56+
apiContact = apiContact == null ? "unknown" : apiContact;
57+
} catch (Exception ex) {
58+
apiContact = "unknown";
59+
}
5660
}
5761
if (clientVersion != null && versions.contains(clientVersion)) {
5862
_clientVersionCounters.computeIfAbsent(new Tuple.Tuple2<>(apiContact, clientVersion), tuple -> Counter

src/main/java/com/uid2/operator/vertx/UIDOperatorVerticle.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,6 @@ private void handleHealthCheck(RoutingContext rc) {
816816
}
817817

818818
private void handleOldSDKVersionLogging(RoutingContext rc) {
819-
// throwaway endpoint to log version
820819
rc.response().end("OK");
821820
}
822821

0 commit comments

Comments
 (0)