Skip to content

Commit eac6e2e

Browse files
authored
Merge branch 'main' into ban/add-size-hint-to-injector
2 parents e58150c + 9cde968 commit eac6e2e

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

opentelemetry-http/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ http = { workspace = true }
2626
http-body-util = { workspace = true, optional = true }
2727
hyper = { workspace = true, optional = true }
2828
hyper-util = { workspace = true, features = ["client-legacy", "http1", "http2"], optional = true }
29-
opentelemetry = { workspace = true, features = ["trace"] }
29+
opentelemetry = { path = "../opentelemetry", version = "0.30.0", features = ["trace"] }
3030
reqwest = { workspace = true, optional = true }
3131
tokio = { workspace = true, features = ["time"], optional = true }
3232

opentelemetry-http/src/lib.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,6 @@ impl Extractor for HeaderExtractor<'_> {
4848
.map(|value| value.as_str())
4949
.collect::<Vec<_>>()
5050
}
51-
52-
/// Get all the values for a key from the HeaderMap
53-
fn get_all(&self, key: &str) -> Option<Vec<&str>> {
54-
let all_iter = self.0.get_all(key).iter();
55-
if let (0, Some(0)) = all_iter.size_hint() {
56-
return None;
57-
}
58-
59-
Some(all_iter.filter_map(|value| value.to_str().ok()).collect())
60-
}
6151
}
6252

6353
pub type HttpError = Box<dyn std::error::Error + Send + Sync + 'static>;
@@ -256,8 +246,6 @@ impl<T> ResponseExt for Response<T> {
256246

257247
#[cfg(test)]
258248
mod tests {
259-
use http::HeaderValue;
260-
261249
use super::*;
262250

263251
#[test]
@@ -272,32 +260,6 @@ mod tests {
272260
)
273261
}
274262

275-
#[test]
276-
fn http_headers_get_all() {
277-
let mut carrier = http::HeaderMap::new();
278-
carrier.append("headerName", HeaderValue::from_static("value"));
279-
carrier.append("headerName", HeaderValue::from_static("value2"));
280-
carrier.append("headerName", HeaderValue::from_static("value3"));
281-
282-
assert_eq!(
283-
HeaderExtractor(&carrier).get_all("HEADERNAME"),
284-
Some(vec!["value", "value2", "value3"]),
285-
"all values from a key extraction"
286-
)
287-
}
288-
289-
#[test]
290-
fn http_headers_get_all_missing_key() {
291-
let mut carrier = http::HeaderMap::new();
292-
carrier.append("headerName", HeaderValue::from_static("value"));
293-
294-
assert_eq!(
295-
HeaderExtractor(&carrier).get_all("not_existing"),
296-
None,
297-
"all values from a missing key extraction"
298-
)
299-
}
300-
301263
#[test]
302264
fn http_headers_keys() {
303265
let mut carrier = http::HeaderMap::new();

0 commit comments

Comments
 (0)