//! Helpers for reading the `X-Organization-Id` header.

use actix_web::HttpRequest;

/// Returns the organizational identifier sent by the caller.
pub fn get_x_organization_id(req: &HttpRequest) -> Option<String> {
    req.headers()
        .get("X-Organization-Id")
        .and_then(|header| header.to_str().ok())
        .map(|value| value.to_string())
}
