Skip to content
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

Don't create duplicate headers #2727

Merged
merged 18 commits into from
Apr 12, 2021
Merged

Don't create duplicate headers #2727

merged 18 commits into from
Apr 12, 2021

Conversation

trask
Copy link
Member

@trask trask commented Apr 6, 2021

Resolves #2594

Adds a new test to HttpClientTest that create a request, sends the request, and then reuses that request (sending it a second time).

Most of the http client libraries support this kind of reuse, and several of our instrumentations would end up adding the traceparent header multiple times (#2594).

HttpTestServer now throws an exception if there is more than one traceparent header.

To implement the new test, the doRequest() method that was implemented in each subclass of HttpClientTest has been split into two methods:

  • buildRequest()
  • sendRequest()

The normal doRequest (now final) is implemented as buildRequest + sendRequest, while the new doReusedRequest (also final) is implemented as buildRequest + sendRequest + sendRequest.

@trask trask marked this pull request as ready for review April 9, 2021 02:52
@iNikem iNikem merged commit 3bc058b into open-telemetry:main Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HttpHeadersInjectAdapter should use 'setHeader' instead of 'addHeader'?
4 participants