athena_rs 3.3.0

Database gateway API
Documentation
1
2
3
4
5
6
7
8
9
10
//! Helpers for extracting the `X-User-Id` header.
use actix_web::HttpRequest;

/// Returns the user identifier supplied by the caller.
pub fn get_x_user_id(req: &HttpRequest) -> Option<String> {
    req.headers()
        .get("X-User-Id")
        .and_then(|h| h.to_str().ok())
        .map(|s| s.to_string())
}