File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 11#[ cfg( feature = "fasthttp" ) ]
22mod 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}
You can’t perform that action at this time.
0 commit comments