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

Function looks_like_http

crates/openshell-server/src/lib.rs:590–610  ·  view source on GitHub ↗
(prefix: &[u8])

Source from the content-addressed store, hash-verified

588}
589
590fn looks_like_http(prefix: &[u8]) -> bool {
591 const METHODS: [&[u8]; 10] = [
592 b"GET ",
593 b"POST ",
594 b"PUT ",
595 b"PATCH ",
596 b"DELETE ",
597 b"HEAD ",
598 b"OPTIONS ",
599 b"TRACE ",
600 b"CONNECT ",
601 b"PRI ",
602 ];
603
604 if prefix.is_empty() {
605 return false;
606 }
607 METHODS
608 .iter()
609 .any(|method| method.starts_with(prefix) || prefix.starts_with(method))
610}
611
612fn allow_plaintext_service_http(
613 enabled: bool,

Callers 1

classify_initial_bytesFunction · 0.70

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected