MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / get_header

Function get_header

api_client/src/lib.rs:76–80  ·  view source on GitHub ↗
(res: &'a str, header: &'a str)

Source from the content-addressed store, hash-verified

74}
75
76fn get_header<'a>(res: &'a str, header: &'a str) -> Option<&'a str> {
77 let header_str = format!("{header}: ");
78 res.find(&header_str)
79 .map(|o| &res[o + header_str.len()..o + res[o..].find('\r').unwrap()])
80}
81
82fn get_status_code(res: &str) -> Result<StatusCode, Error> {
83 if let Some(o) = res.find("HTTP/1.1") {

Callers 1

parse_http_responseFunction · 0.85

Calls 2

mapMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected