//! 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())
}
