Skip to content

Commit c418fda

Browse files
committed
log: debug
1 parent d5fb63d commit c418fda

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/header/map.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,12 @@ impl<T: Debug> HeaderMap<T> {
849849
where
850850
K: AsHeaderName + Debug,
851851
{
852-
tracing::debug!("get {:?}: {:?}", key, self);
852+
tracing::debug!(
853+
"get {:?}: header_map={:?},backtrace={}",
854+
key,
855+
self,
856+
std::backtrace::Backtrace::force_capture()
857+
);
853858
let v = self.get2(&key);
854859
v
855860
}

tests/fasthttp.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[cfg(feature = "fasthttp")]
22
mod fasthttp_tests {
33
use http::{HeaderMap, HeaderName, HeaderValue, Request};
4+
use http::header::CONTENT_LENGTH;
45

56
#[test]
67
fn test_insert() {
@@ -231,4 +232,12 @@ mod fasthttp_tests {
231232
let header_value = header_value_iter.next().unwrap();
232233
assert_eq!(header_value.to_str().unwrap(), "bar2");
233234
}
235+
236+
#[test]
237+
fn test_contains_key(){
238+
let mut header_map = HeaderMap::new();
239+
header_map.append(HeaderName::from_bytes("content-length".as_bytes()).unwrap(), HeaderValue::from_static("1"));
240+
assert_eq!(header_map.get(CONTENT_LENGTH).unwrap().to_str().unwrap(), "1");
241+
assert_eq!(header_map.contains_key(CONTENT_LENGTH), true);
242+
}
234243
}

0 commit comments

Comments
 (0)