MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / looks_like_http

Function looks_like_http

crates/openshell-supervisor-network/src/l7/rest.rs:2366–2370  ·  view source on GitHub ↗

Detect if the first bytes look like an HTTP request. Checks for common HTTP methods at the start of the stream.

(peek: &[u8])

Source from the content-addressed store, hash-verified

2364///
2365/// Checks for common HTTP methods at the start of the stream.
2366pub fn looks_like_http(peek: &[u8]) -> bool {
2367 HTTP_METHOD_PREFIXES
2368 .iter()
2369 .any(|method| peek.starts_with(method))
2370}
2371
2372pub(crate) fn could_be_http_request_prefix(peek: &[u8]) -> bool {
2373 !peek.is_empty()

Callers 1

classify_tunnel_protocolFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected