Skip to content

Commit

Permalink
Use latest baggage header (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
jtescher authored Oct 6, 2020
1 parent 7f1b57c commit 90a6e36
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/api/baggage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//!
//! // Example baggage value passed in externally via http headers
//! let mut headers = HashMap::new();
//! headers.insert("otcorrelations".to_string(), "user_id=1".to_string());
//! headers.insert("baggage".to_string(), "user_id=1".to_string());
//!
//! let propagator = BaggagePropagator::new();
//! // can extract from any type that impls `Extractor`, usually an HTTP header map
Expand All @@ -37,7 +37,7 @@
//! // Inject aggage into http request
//! propagator.inject_context(&cx_with_additions, &mut headers);
//!
//! let header_value = headers.get("otcorrelations").expect("header is injected");
//! let header_value = headers.get("baggage").expect("header is injected");
//! assert!(header_value.contains("user_id=1"), "still contains previous name / value");
//! assert!(header_value.contains("server_id=42"), "contains new name / value pair");
//! ```
Expand Down
2 changes: 1 addition & 1 deletion src/api/baggage/propagation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::api::{self, Context, KeyValue};
use percent_encoding::{percent_decode_str, utf8_percent_encode, AsciiSet, CONTROLS};
use std::iter;

static BAGGAGE_HEADER: &str = "otcorrelations";
static BAGGAGE_HEADER: &str = "baggage";
const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b';').add(b',').add(b'=');

lazy_static::lazy_static! {
Expand Down
4 changes: 2 additions & 2 deletions src/api/context/propagation/composite_propagator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ use std::fmt::Debug;
/// .with_baggage(vec![KeyValue::new("test", "example")]),
/// &mut injector);
///
/// // The injector now has both `otcorrelations` and `traceparent` headers
/// assert!(injector.get("otcorrelations").is_some());
/// // The injector now has both `baggage` and `traceparent` headers
/// assert!(injector.get("baggage").is_some());
/// assert!(injector.get("traceparent").is_some());
/// ```
#[derive(Debug)]
Expand Down

0 comments on commit 90a6e36

Please sign in to comment.