MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / json_response

Function json_response

gateway/src/proxy/tls_terminate.rs:137–144  ·  view source on GitHub ↗
(body: &impl Serialize)

Source from the content-addressed store, hash-verified

135}
136
137fn json_response(body: &impl Serialize) -> Result<Response<String>> {
138 let body = serde_json::to_string(body).context("Failed to serialize response")?;
139 Response::builder()
140 .status(StatusCode::OK)
141 .header("Content-Type", "application/json")
142 .body(body)
143 .context("Failed to build response")
144}
145
146fn empty_response(status: StatusCode) -> Result<Response<String>> {
147 Response::builder()

Callers 1

handle_this_nodeMethod · 0.85

Calls 1

statusMethod · 0.45

Tested by

no test coverage detected