apply comma split logic to servlet request extract adapter
MODIFY
dd-java-agent/instrumentation/servlet/request-2/src/main/java/datadog/trace/instrumentation/servlet2/HttpServletRequestExtractAdapter.java
dd-java-agent/instrumentation/servlet/request-2/src/main/java/datadog/trace/instrumentation/servlet2/HttpServletRequestExtractAdapter.java
@@ -29,6 +29,8 @@ public class HttpServletRequestExtractAdapter
if (attribute instanceof String) {
return (String) attribute;
}
- return carrier.getHeader(key);
+ String s = carrier.getHeader(key);
+ if (s == null) return null;
+ return s.split(",")[0].trim();
}
}

MODIFY
dd-java-agent/instrumentation/servlet/request-3/src/main/java/datadog/trace/instrumentation/servlet3/HttpServletRequestExtractAdapter.java
dd-java-agent/instrumentation/servlet/request-3/src/main/java/datadog/trace/instrumentation/servlet3/HttpServletRequestExtractAdapter.java
@@ -29,6 +29,8 @@ public class HttpServletRequestExtractAdapter
if (attribute instanceof String) {
return (String) attribute;
}
- return carrier.getHeader(key);
+ String s = carrier.getHeader(key);
+ if (s == null) return null;
+ return s.split(",")[0].trim();
}
}

apply comma split logic to servlet request extract adapter