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

Function service_request

crates/openshell-server/src/lib.rs:1030–1043  ·  view source on GitHub ↗
(addr: SocketAddr, extra_headers: &[(&str, &str)])

Source from the content-addressed store, hash-verified

1028 }
1029
1030 fn service_request(addr: SocketAddr, extra_headers: &[(&str, &str)]) -> String {
1031 let mut request = format!(
1032 "GET / HTTP/1.1\r\nHost: my-sandbox--web.dev.openshell.localhost:{}\r\nConnection: close\r\n",
1033 addr.port()
1034 );
1035 for (name, value) in extra_headers {
1036 request.push_str(name);
1037 request.push_str(": ");
1038 request.push_str(value);
1039 request.push_str("\r\n");
1040 }
1041 request.push_str("\r\n");
1042 request
1043 }
1044
1045 async fn stop_listener(shutdown: watch::Sender<bool>, handle: tokio::task::JoinHandle<()>) {
1046 let _ = shutdown.send(true);

Calls

no outgoing calls

Tested by

no test coverage detected