Fix okhttp-3.x and async-http-client-2.x did not overwrite the old trace header. (#5917)

* Fix okhttp-3.x and async-http-client-2.x did not overwrite the old trace header.
This commit is contained in:
zifeihan 2020-11-27 22:31:39 +08:00 committed by GitHub
parent fdee001788
commit 408bd3db5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -65,7 +65,7 @@ public class ExecuteInterceptor implements InstanceMethodsAroundInterceptor {
CarrierItem next = contextCarrier.items(); CarrierItem next = contextCarrier.items();
while (next.hasNext()) { while (next.hasNext()) {
next = next.next(); next = next.next();
headers.add(next.getHeadKey(), next.getHeadValue()); headers.set(next.getHeadKey(), next.getHeadValue());
} }
} }

View File

@ -78,7 +78,7 @@ public class AsyncCallInterceptor implements InstanceConstructorInterceptor, Ins
CarrierItem next = contextCarrier.items(); CarrierItem next = contextCarrier.items();
while (next.hasNext()) { while (next.hasNext()) {
next = next.next(); next = next.next();
headerBuilder.add(next.getHeadKey(), next.getHeadValue()); headerBuilder.set(next.getHeadKey(), next.getHeadValue());
} }
headersField.set(request, headerBuilder.build()); headersField.set(request, headerBuilder.build());

View File

@ -23,6 +23,7 @@ Release Notes.
* Fix the default ignore mechanism isn't accurate enough bug. * Fix the default ignore mechanism isn't accurate enough bug.
* Add the plugin for spring-kafka 1.3.x. * Add the plugin for spring-kafka 1.3.x.
* Add the plugin for Apache CXF 3.x. * Add the plugin for Apache CXF 3.x.
* Fix okhttp-3.x and async-http-client-2.x did not overwrite the old trace header.
#### OAP-Backend #### OAP-Backend
* Add the `@SuperDataset` annotation for BrowserErrorLog. * Add the `@SuperDataset` annotation for BrowserErrorLog.