netty 4.0: do not modify headers in aws request

This commit is contained in:
Nikolay Martynov 2019-01-25 15:50:43 -05:00
parent 5029660418
commit d4943eb2b6
2 changed files with 7 additions and 4 deletions

View File

@ -53,9 +53,12 @@ public class HttpClientRequestTracingHandler extends ChannelOutboundHandlerAdapt
.withTag(DDTags.SPAN_TYPE, DDSpanTypes.HTTP_CLIENT)
.start();
// AWS calls are often signed, so we can't add headers without breaking the signature.
if (!request.headers().contains("amz-sdk-invocation-id")) {
GlobalTracer.get()
.inject(
span.context(), Format.Builtin.HTTP_HEADERS, new NettyResponseInjectAdapter(request));
}
ctx.channel().attr(AttributeKeys.CLIENT_ATTRIBUTE_KEY).set(span);