diff --git a/newrelic-agent/src/main/java/com/newrelic/agent/tracing/W3CTraceParentParser.java b/newrelic-agent/src/main/java/com/newrelic/agent/tracing/W3CTraceParentParser.java index 9c7c4e0e08..9d47cd0da4 100644 --- a/newrelic-agent/src/main/java/com/newrelic/agent/tracing/W3CTraceParentParser.java +++ b/newrelic-agent/src/main/java/com/newrelic/agent/tracing/W3CTraceParentParser.java @@ -24,17 +24,12 @@ static W3CTraceParent parseHeaders(List traceParentHeaders) { ServiceFactory.getStatsService().getMetricAggregator().incrementCounter(MetricNames.SUPPORTABILITY_TRACE_CONTEXT_INVALID_PARENT_HEADER_COUNT); Agent.LOG.log(Level.WARNING, "Multiple traceparent headers found on inbound request."); // Multiple values ok if all are equal - boolean allHeadersEqual = true; String first = traceParentHeaders.get(0); for (String header : traceParentHeaders) { if (!header.equals(first)) { - allHeadersEqual = false; - break; + return null; } } - if (!allHeadersEqual) { - return null; - } } String traceParentHeader = traceParentHeaders.get(0); return parseHeader(traceParentHeader);