MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / request_insert_auth_header

Function request_insert_auth_header

sdks/rust/src/websocket.rs:255–260  ·  view source on GitHub ↗
(req: &mut http::Request<()>, token: Option<&str>)

Source from the content-addressed store, hash-verified

253
254#[cfg(not(feature = "browser"))]
255fn request_insert_auth_header(req: &mut http::Request<()>, token: Option<&str>) {
256 if let Some(token) = token {
257 let auth = ["Bearer ", token].concat().try_into().unwrap();
258 req.headers_mut().insert(http::header::AUTHORIZATION, auth);
259 }
260}
261
262#[cfg(feature = "browser")]
263async fn fetch_ws_token(host: &Uri, auth_token: &str) -> Result<String, WsError> {

Callers 1

make_requestFunction · 0.85

Calls 3

try_intoMethod · 0.80
insertMethod · 0.65
unwrapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…