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

use actix_web::HttpRequest;

/// Returns the company identifier carried in the request headers.
#[deprecated(note = "Use tenant/auth context helpers instead of X-Company-Id header access.")]
pub fn get_x_company_id(req: &HttpRequest) -> Option<String> {
    req.headers()
        .get("X-Company-Id")
        .and_then(|header| header.to_str().ok())
        .map(|value| value.to_string())
}
