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

Function is_bodiless_response

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

Returns true for responses that MUST NOT contain a message body per RFC 7230 §3.3.3: HEAD responses, 1xx informational, 204 No Content, 304 Not Modified.

(request_method: &str, status_code: u16)

Source from the content-addressed store, hash-verified

2303/// Returns true for responses that MUST NOT contain a message body per RFC 7230 §3.3.3:
2304/// HEAD responses, 1xx informational, 204 No Content, 304 Not Modified.
2305fn is_bodiless_response(request_method: &str, status_code: u16) -> bool {
2306 request_method.eq_ignore_ascii_case("HEAD")
2307 || (100..200).contains(&status_code)
2308 || status_code == 204
2309 || status_code == 304
2310}
2311
2312/// Relay all bytes from reader to writer until EOF or idle timeout.
2313///

Callers 1

relay_responseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected