MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / cookie_token

Function cookie_token

packages/server/src/auth.rs:195–201  ·  view source on GitHub ↗
(headers: &HeaderMap)

Source from the content-addressed store, hash-verified

193}
194
195fn cookie_token(headers: &HeaderMap) -> Option<&str> {
196 let cookie = headers.get(header::COOKIE)?.to_str().ok()?;
197 cookie.split(';').find_map(|part| {
198 let (name, value) = part.trim().split_once('=')?;
199 (name == ACCESS_TOKEN_COOKIE).then_some(value.trim())
200 })
201}
202
203fn query_token_from_query(query: Option<&str>) -> Option<&str> {
204 let query = query?;

Callers 1

api_request_authorizedFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected