Skip to content

Commit 2ffc5bb

Browse files
committed
restrict baggage key further
1 parent 01cbc57 commit 2ffc5bb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

opentelemetry/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- Align `Baggage.remove()` signature with `.get()` to take the key as a reference
1414
- `Baggage` can't be retrieved from the `Context` directly anymore and needs to be accessed via `context.baggage()`
1515
- `with_baggage()` and `current_with_baggage()` override any existing `Baggage` in the `Context`
16-
- `Baggage` keys can't be empty and don't allow `"(),/:;<=>?@[\]{}` chars (see [RFC7230, Section 3.2.6](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6))
16+
- `Baggage` keys can't be empty and only allow ASCII visual chars, except `"(),/:;<=>?@[\]{}` (see [RFC7230, Section 3.2.6](https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6))
1717
- Changed `Context` to use a stack to properly handle out of order dropping of `ContextGuard`. This imposes a limit of `65535` nested contexts on a single thread. See #[2378](https://github.com/open-telemetry/opentelemetry-rust/pull/2284) and #[1887](https://github.com/open-telemetry/opentelemetry-rust/issues/1887).
1818
- Added additional `name: Option<&str>` parameter to the `event_enabled` method
1919
on the `Logger` trait. This allows implementations (SDK, processor, exporters)

opentelemetry/src/baggage.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl Baggage {
230230
!key.is_empty()
231231
&& key
232232
.iter()
233-
.all(|b| b.is_ascii() && !INVALID_ASCII_KEY_CHARS.contains(b))
233+
.all(|b| b.is_ascii_graphic() && !INVALID_ASCII_KEY_CHARS.contains(b))
234234
}
235235
}
236236

0 commit comments

Comments
 (0)