-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: better handling of invalid headers #132
Conversation
When the tracer encounters an invalid propagation header value, logging the list of headers and their values can lead to a crash.
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.
Can we include some unit tests that fail for the old behavior, but pass for the new behavior?
Anyway, if the issue was due to an exception thrown by the JSON library, then this might help in testing. edit: Ah, I bet it's UTF related. Consider auditing the library for other "for convenience" uses of |
@dgoffredo Yes, it's a character encoding / serializing issue.
I was trying to understand what was the purpose, thanks for the context. I will definitely audit for other uses of As always thanks for keeping an eye on |
Description
When the tracer encounters an invalid propagation header value, logging the list of headers and their values is not handled properly.
Details
For each key and value in the list of headers, a
nlohmann::json
instance is created with the following code:stream << nlohmann::json(it->first + ": " + it->second);
It is possible that an input for any of the headers inspected by the tracer exhibits unexpected behavior when the JSON library attempts to parse or dump the input.