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

Function html_response

crates/openshell-cli/src/oidc_auth.rs:437–447  ·  view source on GitHub ↗
(status: StatusCode, message: &str)

Source from the content-addressed store, hash-verified

435}
436
437fn html_response(status: StatusCode, message: &str) -> Response<Full<Bytes>> {
438 let body = format!(
439 "<!DOCTYPE html><html><body style=\"font-family:sans-serif;text-align:center;padding:40px\">\
440 <h2>{message}</h2></body></html>"
441 );
442 Response::builder()
443 .status(status)
444 .header("content-type", "text/html")
445 .body(Full::new(Bytes::from(body)))
446 .expect("response")
447}
448
449#[cfg(test)]
450mod tests {

Callers 1

handle_oidc_callbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected