Name Description Size Coverage
accept_ranges.rs 2760 -
access_control_allow_credentials.rs 2269 -
access_control_allow_headers.rs 2645 -
access_control_allow_methods.rs 2356 -
access_control_allow_origin.rs 4931 -
access_control_expose_headers.rs 2309 -
access_control_max_age.rs 1119 -
access_control_request_headers.rs 2374 -
access_control_request_method.rs 2190 -
age.rs 1767 -
allow.rs 1576 -
authorization.rs Authorization header and types. 9385 -
cache_control.rs 17173 -
connection.rs 3314 -
content_disposition.rs pub fn attachment(filename: &str) -> ContentDisposition { let full = Bytes::from(format!("attachment; filename={}", filename)); match ::HeaderValue::from_maybe_shared(full) { Ok(val) => ContentDisposition(val), Err(_) => { unimplemented!("filename that isn't ASCII"); } } } 11740 -
content_encoding.rs 2473 -
content_length.rs __hyper__tm!(ContentLength, tests { // Testcase from RFC test_header!(test1, vec![b"3495"], Some(HeaderField(3495))); test_header!(test_invalid, vec![b"34v95"], None); // Can't use the test_header macro because "5, 5" gets cleaned to "5". #[test] fn test_duplicates() { let parsed = HeaderField::parse_header(&vec![b"5".to_vec(), b"5".to_vec()].into()).unwrap(); assert_eq!(parsed, HeaderField(5)); assert_eq!(format!("{}", parsed), "5"); } test_header!(test_duplicates_vary, vec![b"5", b"6", b"5"], None); }); 3032 -
content_location.rs 1436 -
content_range.rs 6989 -
content_type.rs 4961 -
cookie.rs impl PartialEq for Cookie { fn eq(&self, other: &Cookie) -> bool { if self.0.len() == other.0.len() { for &(ref k, ref v) in self.0.iter() { if other.get(k) != Some(v) { return false; } } true } else { false } } } 5979 -
date.rs 887 -
etag.rs test_etag { // From the RFC test_header!(test1, vec![b"\"xyzzy\""], Some(ETag(EntityTag::new(false, "xyzzy".to_owned())))); test_header!(test2, vec![b"W/\"xyzzy\""], Some(ETag(EntityTag::new(true, "xyzzy".to_owned())))); test_header!(test3, vec![b"\"\""], Some(ETag(EntityTag::new(false, "".to_owned())))); // Own tests test_header!(test4, vec![b"\"foobar\""], Some(ETag(EntityTag::new(false, "foobar".to_owned())))); test_header!(test5, vec![b"\"\""], Some(ETag(EntityTag::new(false, "".to_owned())))); test_header!(test6, vec![b"W/\"weak-etag\""], Some(ETag(EntityTag::new(true, "weak-etag".to_owned())))); test_header!(test7, vec![b"W/\"\x65\x62\""], Some(ETag(EntityTag::new(true, "\u{0065}\u{0062}".to_owned())))); test_header!(test8, vec![b"W/\"\""], Some(ETag(EntityTag::new(true, "".to_owned())))); test_header!(test9, vec![b"no-dquotes"], None::<ETag>); test_header!(test10, vec![b"w/\"the-first-w-is-case-sensitive\""], None::<ETag>); test_header!(test11, vec![b""], None::<ETag>); test_header!(test12, vec![b"\"unmatched-dquotes1"], None::<ETag>); test_header!(test13, vec![b"unmatched-dquotes2\""], None::<ETag>); test_header!(test14, vec![b"matched-\"dquotes\""], None::<ETag>); test_header!(test15, vec![b"\""], None::<ETag>); } 3142 -
expect.rs 2023 -
expires.rs 1141 -
host.rs 1371 -
if_match.rs 2806 -
if_modified_since.rs 1951 -
if_none_match.rs test_if_none_match { test_header!(test1, vec![b"\"xyzzy\""]); test_header!(test2, vec![b"W/\"xyzzy\""]); test_header!(test3, vec![b"\"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\""]); test_header!(test4, vec![b"W/\"xyzzy\", W/\"r2d2xxxx\", W/\"c3piozzzz\""]); test_header!(test5, vec![b"*"]); } 2945 -
if_range.rs #[cfg(test)] mod tests { use std::str; use *; use super::IfRange as HeaderField; test_header!(test1, vec![b"Sat, 29 Oct 1994 19:43:31 GMT"]); test_header!(test2, vec![b"\"xyzzy\""]); test_header!(test3, vec![b"this-is-invalid"], None::<IfRange>); } 3929 -
if_unmodified_since.rs 2072 -
last_modified.rs 1209 -
location.rs 1193 -
mod.rs A Collection of Header implementations for common HTTP Headers. ## Mime Several header fields use MIME values for their contents. Keeping with the strongly-typed theme, the [mime](https://docs.rs/mime) crate is used, such as `ContentType(pub Mime)`. 5963 -
origin.rs 5939 -
pragma.rs 1600 -
proxy_authorization.rs 1641 -
range.rs 15545 -
referer.rs 1651 -
referrer_policy.rs 5593 -
retry_after.rs 3380 -
sec_websocket_accept.rs from request headers 1815 -
sec_websocket_key.rs 732 -
sec_websocket_version.rs 1583 -
server.rs 1831 -
set_cookie.rs 3769 -
strict_transport_security.rs 7728 -
te.rs 1066 -
transfer_encoding.rs 2954 -
upgrade.rs 1533 -
user_agent.rs 2091 -
vary.rs test_vary { test_header!(test1, vec![b"accept-encoding, accept-language"]); #[test] fn test2() { let mut vary: ::Result<Vary>; vary = Header::parse_header(&"*".into()); assert_eq!(vary.ok(), Some(Vary::Any)); vary = Header::parse_header(&"etag,cookie,allow".into()); assert_eq!(vary.ok(), Some(Vary::Items(vec!["eTag".parse().unwrap(), "cookIE".parse().unwrap(), "AlLOw".parse().unwrap(),]))); } } 2083 -