oidc-util 0.0.1

OIDC utility
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use actix_web::http::header::HeaderMap;

pub mod validator;

/// returns an empty string
pub fn extract_header_value_from_request_to_string<'a>(
    headers: &'a HeaderMap,
    header_name: &'a str,
) -> &'a str {
    if let Some(header) = headers.get(header_name) {
        match header.to_str() {
            Ok(str_value) => str_value,
            Err(_) => "",
        }
    } else {
        ""
    }
}