-
Notifications
You must be signed in to change notification settings - Fork 831
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
Adds '+' character to allowed characters in baggage value #4898
Conversation
Codecov ReportBase: 90.90% // Head: 90.98% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #4898 +/- ##
============================================
+ Coverage 90.90% 90.98% +0.07%
- Complexity 4803 4839 +36
============================================
Files 545 546 +1
Lines 14340 14439 +99
Branches 1383 1395 +12
============================================
+ Hits 13036 13137 +101
+ Misses 897 894 -3
- Partials 407 408 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Your interpretation is correct. I also wondered if there is any performance benefit in checking for the presence of I think its either this approach or vendoring in some other url decoder like apache URLCodec. |
api/all/src/test/java/io/opentelemetry/api/baggage/propagation/W3CBaggagePropagatorTest.java
Outdated
Show resolved
Hide resolved
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.
This is looking good. Just a couple of minor cleanups.
api/all/src/main/java/io/opentelemetry/api/baggage/propagation/BaggageCodec.java
Outdated
Show resolved
Hide resolved
api/all/src/main/java/io/opentelemetry/api/baggage/propagation/BaggageCodec.java
Outdated
Show resolved
Hide resolved
api/all/src/main/java/io/opentelemetry/api/baggage/propagation/BaggageCodec.java
Outdated
Show resolved
Hide resolved
api/all/src/main/java/io/opentelemetry/api/baggage/propagation/BaggageCodec.java
Outdated
Show resolved
Hide resolved
api/all/src/main/java/io/opentelemetry/api/baggage/propagation/BaggageCodec.java
Show resolved
Hide resolved
* @return decoded value | ||
*/ | ||
@Nullable | ||
static String decode(@Nullable String value, Charset charset) { |
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.
Looks like value
is never null. Can remove the @Nullable
annotation on the value
argument, and also maybe on the response. That should improve test coverage.
Same recommendation applies to private static byte[] decode(@Nullable byte[] bytes)
above.
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.
Just the one last comment about @Nullable
. Thanks!
…etry#4898) * Adds '+' character to allowed characters in baggade value * Formatting fix * Adda BaggageCodec implementation * Additional cleanup * Removal of Nullable method parameters. * Additional tests for baggage decoding
This is a bit dirty way to fix it, but the alternative would be to rewrite from scratch
URLDecoder
, which treats+
character asspace
. We can't useURLDecorder
source code and modify it, since it is GPL licensed (at least that is how I understand it).Maybe we could use some other implementation of URL Decoder that allows for greater customization, but nothing comes to my mind.
Fixes: #4892