MCPcopy Create free account
hub / github.com/AI45Lab/Code / capture_session_id

Method capture_session_id

core/src/mcp/transport/streamable_http.rs:117–124  ·  view source on GitHub ↗

Extract and store session ID from response headers.

(&self, headers: &reqwest::header::HeaderMap)

Source from the content-addressed store, hash-verified

115
116 /// Extract and store session ID from response headers.
117 async fn capture_session_id(&self, headers: &reqwest::header::HeaderMap) {
118 if let Some(val) = headers.get("Mcp-Session-Id") {
119 if let Ok(s) = val.to_str() {
120 let mut sid = self.session_id.write().await;
121 *sid = Some(s.to_string());
122 }
123 }
124 }
125
126 /// Parse a JSON-RPC response from either plain JSON or SSE stream body.
127 async fn parse_response(response: reqwest::Response) -> Result<JsonRpcResponse> {

Callers 1

requestMethod · 0.80

Calls 2

writeMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected