Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Should use Set() instead of Add() in HTTPHeadersCarrier #159

Closed
vetinari opened this issue Sep 25, 2017 · 2 comments
Closed

Should use Set() instead of Add() in HTTPHeadersCarrier #159

vetinari opened this issue Sep 25, 2017 · 2 comments

Comments

@vetinari
Copy link

When re-using an incoming http.Request, Add() will create a double header (i.e. result is a comma separated value), see also instana/go-sensor#40

@jeremyxu2010
Copy link
Contributor

+1

jeremyxu2010 added a commit to jeremyxu2010/opentracing-go that referenced this issue Aug 22, 2018
Should use Set() instead of Add() in HTTPHeadersCarrier. see opentracing#159
vetinari added a commit to vetinari/lightstep-tracer-go that referenced this issue Sep 7, 2018
because of opentracing/opentracing-go#159
the headers in a reused *http.Request are appended instead of set
which results in headers like this after injecting the current span
context:
```
ot-tracer-spanid: 911775291efa49de,46fbd688b66dc96d
ot-tracer-traceid: 24080003fd414b3d,24080003fd414b3d
ot-tracer-sampled: true,true
```

With these double headers at least the java client is unable to
extract the current span context.
szuecs added a commit to szuecs/opentracing-go that referenced this issue Sep 7, 2018
@tobias-bahls
Copy link

Such headers might cause OpenTracing implementations on the JVM throw an unchecked IllegalArgumentException, which is not handled properly in e.g. https://github.com/opentracing-contrib/java-web-servlet-filter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants