-
Notifications
You must be signed in to change notification settings - Fork 657
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
Baggage value is not parsed correctly in downstream server #2010
Comments
Issue is that we use quote_plus to encode but quote to decode. opentelemetry-python/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py Line 100 in 71e3a7a
opentelemetry-python/opentelemetry-api/src/opentelemetry/baggage/propagation/__init__.py Line 68 in 71e3a7a
We need to figure out which encoding the spec recommends and other otel projects use before fixing this. |
https://w3c.github.io/baggage/#definition
By this definition baggage values with space shouldn't be allowed in the first place, isn't it? |
Go has the validation for baggage items |
This issue was marked stale due to lack of activity. It will be closed in 30 days. |
* Add regexes to check keys and values Fixes #2010 * Fix tests * Add changelog * Fix test * Add checks to set_baggage * Fix lint * Add changelog entry * Fix mypy * Fix mypy * Cast to string * WIP * Key value format * Mostly done * Remove old changelog entry * fomat * Correct typing * Fix lint * Fix issues * Add CHANGELOG entry * Make changes as discussed in SIG meeting * Update opentelemetry-api/src/opentelemetry/baggage/__init__.py Co-authored-by: Leighton Chen <[email protected]> Co-authored-by: Diego Hurtado <[email protected]> Co-authored-by: Leighton Chen <[email protected]>
Environment:
Python 3.7.9, Ubuntu 20.04
opentelemetry-api 1.4.0
opentelemetry-sdk 1.4.0
flask 1.1.3
requests 2.26.0
Setup: A flask upstream server (to set_baggage) and downstream server (to get_baggage).
Attached requirements.txt if any additional dependency information is needed
Steps to reproduce
Upon setting the baggage in the upstream server and trying to get baggage in downstream server, I am not able to get the original value of the baggage.
Whitespaces are replaced by '+' symbol. e.g. Value in baggage
My Random Value
changes toMy+Random+Value
In the upstream server I am able to extract the original value of the baggage.
Sample code for upstream
But in downstream server when I extract the baggage using get_baggage I am not able to get the original value.
Expected behaviour
Downstream server should be able to get original value of baggage.
The text was updated successfully, but these errors were encountered: