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

Function parse_status_code

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

Parse the HTTP status code from a response status line. Expects the first line to look like `HTTP/1.1 200 OK`.

(headers: &str)

Source from the content-addressed store, hash-verified

2090///
2091/// Expects the first line to look like `HTTP/1.1 200 OK`.
2092fn parse_status_code(headers: &str) -> Option<u16> {
2093 let status_line = headers.lines().next()?;
2094 let code_str = status_line.split_whitespace().nth(1)?;
2095 code_str.parse().ok()
2096}
2097
2098/// Check if the response headers contain `Connection: close`.
2099fn parse_connection_close(headers: &str) -> bool {

Callers 1

relay_responseFunction · 0.85

Calls 2

nextMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected