refactor(http1): include bytes in invalid header name panic (#2286)

This commit is contained in:
Sean McArthur
2020-09-18 10:08:44 -07:00
committed by GitHub
parent 187c22afb5
commit d8622e570c

View File

@@ -34,7 +34,10 @@ macro_rules! header_name {
#[cfg(not(debug_assertions))]
{
HeaderName::from_bytes($bytes).expect("header name validated by httparse")
match HeaderName::from_bytes($bytes) {
Ok(name) => name,
Err(_) => panic!("illegal header name from httparse: {:?}", $bytes),
}
}
}};
}