Add max baggage length as limitation#8222
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8222 +/- ##
=====================================
Coverage 82.9% 82.9%
=====================================
Files 314 314
Lines 24998 25024 +26
=====================================
+ Hits 20745 20768 +23
- Misses 3881 3882 +1
- Partials 372 374 +2
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Adds stricter enforcement of W3C Baggage size limits across parsing (baggage) and extraction (propagation), and reduces overhead/error verbosity for malformed inputs.
Changes:
- Enforce an 8192-byte maximum baggage string size in
baggage.Parse, and cap joined parse errors to a fixed maximum. - Add an aggregate byte budget guard when extracting from multiple
baggageheader values in the propagator. - Update/add tests and a benchmark to cover oversized inputs and aggregate-budget behavior, plus a changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
propagation/baggage.go |
Adds aggregate byte budget limit when processing multiple baggage header values. |
propagation/baggage_test.go |
Updates expectations for aggregate-budget behavior and adds new extraction tests. |
baggage/baggage.go |
Adds max-size early rejection and caps how many parse errors are joined. |
baggage/baggage_test.go |
Updates parse tests for new oversize behavior; adds benchmark and error-cap test. |
CHANGELOG.md |
Adds a release note about the baggage parsing/extraction change. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…o into fix/baggage-parsing
MrAlias
left a comment
There was a problem hiding this comment.
Thanks for tightening the aggregate-size handling here. I think there is one edge case left around repeated baggage headers where the combined wire value can still exceed the intended limit. I left an inline note on the specific check with the concrete case and the adjustment that should make the enforcement consistent.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Can you add both benchmark and benchstat results to the PR description? |
Uh oh!
There was an error while loading. Please reload this page.