Skip to content

Commit 0885a1a

Browse files
avinash-newrelicswatijha23
authored andcommitted
fix: pr review comments
1 parent 7aa1226 commit 0885a1a

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/auth/TokenManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ private String buildTokenEndpoint() {
164164
}
165165

166166
// Otherwise, auto-detect from region
167-
String region = configuration.getRegion().toUpperCase();
167+
String region = configuration.getRegion();
168+
region = (region != null) ? region.toUpperCase() : "US";
168169
switch (region) {
169170
case "EU":
170171
return "https://mobile-collector.eu.newrelic.com/mobile/v5/connect";

NewRelicVideoCore/src/main/java/com/newrelic/videoagent/core/harvest/OptimizedHttpClient.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public OptimizedHttpClient(NRVideoConfiguration configuration, android.content.C
6363
this.endpointUrl = "https://" + configuration.getCollectorAddress() + "/mobile/v3/data";
6464
} else {
6565
// Otherwise, auto-detect from region
66-
String region = configuration.getRegion().toUpperCase();
67-
String regionEndpoint = REGIONAL_ENDPOINTS.get(region);
68-
this.endpointUrl = regionEndpoint != null ? regionEndpoint : REGIONAL_ENDPOINTS.get("DEFAULT");
66+
String region = configuration.getRegion();
67+
region = (region != null) ? region.toUpperCase() : "US";
68+
this.endpointUrl = REGIONAL_ENDPOINTS.getOrDefault(region, REGIONAL_ENDPOINTS.get("DEFAULT"));
6969
}
7070

7171
if (configuration.isMemoryOptimized()) {

0 commit comments

Comments
 (0)