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

Function extract_response_metadata

crates/openshell-router/src/backend.rs:646–654  ·  view source on GitHub ↗

Extract status and headers from a [`reqwest::Response`].

(response: &reqwest::Response)

Source from the content-addressed store, hash-verified

644
645/// Extract status and headers from a [`reqwest::Response`].
646fn extract_response_metadata(response: &reqwest::Response) -> (u16, Vec<(String, String)>) {
647 let status = response.status().as_u16();
648 let headers: Vec<(String, String)> = response
649 .headers()
650 .iter()
651 .map(|(k, v)| (k.to_string(), v.to_str().unwrap_or("").to_string()))
652 .collect();
653 (status, headers)
654}
655
656/// Forward a raw HTTP request to the backend configured in `route`.
657///

Callers 2

proxy_to_backendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected