pub fn format_session_header(context: &SessionContext) -> StringExpand description
Helper function to format session context for response headers
This is primarily useful for JMAP and other HTTP-based protocols where you can include session IDs in response headers.
§Arguments
context- The session context
§Returns
A formatted string suitable for use in a response header (just the session ID)
§Example
use rusmes_server::session_logging::{SessionContext, format_session_header};
use std::net::IpAddr;
let session = SessionContext::new(
IpAddr::from([127, 0, 0, 1]),
"JMAP",
);
let header_value = format_session_header(&session);
// Use in HTTP response: X-Session-Id: <uuid>