Detect if the first bytes look like an HTTP request. Checks for common HTTP methods at the start of the stream.
(peek: &[u8])
| 2364 | /// |
| 2365 | /// Checks for common HTTP methods at the start of the stream. |
| 2366 | pub fn looks_like_http(peek: &[u8]) -> bool { |
| 2367 | HTTP_METHOD_PREFIXES |
| 2368 | .iter() |
| 2369 | .any(|method| peek.starts_with(method)) |
| 2370 | } |
| 2371 | |
| 2372 | pub(crate) fn could_be_http_request_prefix(peek: &[u8]) -> bool { |
| 2373 | !peek.is_empty() |
no outgoing calls
no test coverage detected