-
Notifications
You must be signed in to change notification settings - Fork 812
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(instrumentation-http): skip malformed forwarded headers #5099
fix(instrumentation-http): skip malformed forwarded headers #5099
Conversation
|
I think this would solve an issue we stumbled upon, where the forwarded header contains a base64 encoded value that ends with a Could you add a test case for this value?
|
@omBratteng not sure there's much value adding tests for different kinds of malformed
so it should be covered by this fix as well. |
61f4855
to
bc159fb
Compare
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 good - thanks for taking care of this 👍
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5099 +/- ##
=======================================
Coverage 93.18% 93.18%
=======================================
Files 315 315
Lines 8086 8086
Branches 1617 1617
=======================================
Hits 7535 7535
Misses 551 551 |
@pichlermarc is it possible to know when this will be released? One of our app uses the version with the issue and we are wondering either downgrade or wait for the new release - Thanks |
@kiyaGu I published it just now ( |
Which problem is this PR solving?
Skips malformed
forwarded
headers instead of throwing an uncaught exception.Fixes #5095
Short description of the changes
Introduce
parseForwardedHeader
inexperimental/packages/opentelemetry-instrumentation-http/src/utils.ts
which wrapsforwarded-parse
and returns an empty array on any caught exception.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
First, wrote a test that broke the instrumentation in the expected way (throwing
ParseError: Unexpected end of input
).Then, fixed it and confirmed the test passes.
Checklist: