-
Notifications
You must be signed in to change notification settings - Fork 318
Prevent headers from being added for AWS client calls #206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
c6a666d to
91b597d
Compare
91b597d to
bc3170b
Compare
bc3170b to
c1f73c1
Compare
|
It looks like the aws contrib mucks with the headers as well. Do you think that has anything to do with the auth failure? https://github.com/opentracing-contrib/java-aws-sdk/blob/master/src/main/java/io/opentracing/contrib/aws/TracingRequestHandler.java#L68-L69 |
|
@realark So while I think the remaining inject is unnecessary, I don't think it is going to break the signature as it looks like that gets called before the signature is generated, so those headers should be included in the signature. This was not the case by the apache httpclient instrumentation added headers. |
cb602d5 to
2470349
Compare
Handler was being added on builder return, which was too late. It appears it would have also failed if an existing handler resulted in a unmodifiable list to be returned.
2470349 to
13c774e
Compare
|
|
||
| final boolean awsClientCall = request.getHeaders("amz-sdk-invocation-id").length > 0; | ||
| // AWS calls are often signed, so we can't add headers without breaking the signature. | ||
| if (!awsClientCall) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This also fixes the AWS integration. The request handler was being added too late, so it was having no effect. Additional testing is added too.