Skip to content

Commit 0e37cd6

Browse files
committed
Fix client_Browser populated incorrectly
1 parent 6c59275 commit 0e37cd6

File tree

1 file changed

+5
-0
lines changed
  • core/src/main/java/com/microsoft/applicationinsights/internal/channel/common

1 file changed

+5
-0
lines changed

core/src/main/java/com/microsoft/applicationinsights/internal/channel/common/ApacheSender43.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ private static CloseableHttpClient init() {
150150
cm.setMaxTotal(DEFAULT_MAX_TOTAL_CONNECTIONS);
151151
cm.setDefaultMaxPerRoute(DEFAULT_MAX_CONNECTIONS_PER_ROUTE);
152152
HttpClientBuilder builder = HttpClients.custom()
153+
// need to set empty User-Agent, otherwise Breeze ingestion service will put the Apache HttpClient User-Agent header
154+
// into the client_Browser field for all telemetry that doesn't explicitly set it's own UserAgent
155+
// (ideally Breeze would only have this behavior for ingestion directly from browsers)
156+
// (not setting User-Agent header at all would be a good option, but Apache HttpClient doesn't have a simple way to do that)
157+
.setUserAgent("")
153158
.setConnectionManager(cm)
154159
.useSystemProperties();
155160
if (proxy != null) {

0 commit comments

Comments
 (0)