Fix memory leak when using ktor-client-java
MODIFY
instrumentation/java-http-client/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpclient/BodyHandlerWrapper.java
instrumentation/java-http-client/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/httpclient/BodyHandlerWrapper.java
@@ -30,7 +30,7 @@ public class BodyHandlerWrapper<T> implements BodyHandler<T> {
if (subscriber instanceof BodySubscriberWrapper) {
return subscriber;
}
- return new BodySubscriberWrapper<>(delegate.apply(responseInfo), context);
+ return new BodySubscriberWrapper<>(subscriber, context);
}
public static class BodySubscriberWrapper<T> implements BodySubscriber<T> {

Fix memory leak when using ktor-client-java (#4637)