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

ITextMap questions #105

Open
grounded042 opened this issue Jul 30, 2018 · 1 comment
Open

ITextMap questions #105

grounded042 opened this issue Jul 30, 2018 · 1 comment
Labels

Comments

@grounded042
Copy link

While working on adding propagation support for the W3C standard in the Jaeger client I ran into a question about using ITextMap. This is related directly to supporting HTTP headers via ITextMap. The solution on my end might be to not support ITextMap for this propagation method, but I'd like to stick with ITextMap if I can.

According to RFC7230 section 3.2.2 you can have multiple headers with the same name if:

the entire field value for that header field is defined as a comma-separated list

Using ITextMap like we have before makes this hard as it has a Set method that doesn't really allow for multiple keys even though the underlying implementation might. IF the backing for an ITextMap is something like WebHeaderCollection then I don't think this would be a problem as it looks like C# supports multiple headers with the same name as WebHeaderCollection acts similarly to RFC7230 section 3.2.2 in that you can "add" multiple keys but in reality it just adds the value to the end of a comma separated list with that keys name.

My question is: based on the above would it be better for me to use IFormat< WebHeaderCollection> than IFormat<ITextMap>?

Also, would it be of any interest / in the scope of this project to provide small ITextMap wrappers for things like WebHeaderCollection?

@cwe1ss
Copy link
Member

cwe1ss commented Aug 29, 2018

One problem is that .NET doesn't use WebHeaderCollection everywhere, ASP.NET Core has its own IHeaderDictionary interface for this. So it seems like we always need an abstraction.

Could you just "hide" that multi-key logic in your ITextMap<WebHeaderCollection> implementation or is there anything you need to have exposed?

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

No branches or pull requests

2 participants