From fdd242edb06336de2ab57522d0896356d5d8e624 Mon Sep 17 00:00:00 2001 From: whfjam <45580443+whfjam@users.noreply.github.com> Date: Mon, 10 Aug 2020 13:41:31 +0800 Subject: [PATCH] Update HttpClientExecuteInterceptor.java (#5283) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit use the method httpMethod.setRequestHeader to set the new skywalking headers,so that it can override the exits headers if there is any Co-authored-by: 吴晟 Wu Sheng --- .../apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java b/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java index aa86e5334..1144dd37a 100644 --- a/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java +++ b/apm-sniffer/apm-sdk-plugin/httpclient-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/httpclient/v3/HttpClientExecuteInterceptor.java @@ -65,7 +65,7 @@ public class HttpClientExecuteInterceptor implements InstanceMethodsAroundInterc for (CarrierItem next = contextCarrier.items(); next.hasNext(); ) { next = next.next(); - httpMethod.addRequestHeader(next.getHeadKey(), next.getHeadValue()); + httpMethod.setRequestHeader(next.getHeadKey(), next.getHeadValue()); } }