this-env 0.1.32

This.Env Data Formatter
Documentation
1
2
3
4
5
6
7
8
9
10
11
//this.env/crate/src/middleware/actix/utils.rs
// by suiGn
//! Helper utilities for actix middleware processing.
use std::collections::HashMap;
use actix_web::http::header::HeaderMap;
pub fn headers_to_hashmap(headers: &HeaderMap) -> HashMap<String, String> {
    headers
        .iter()
        .filter_map(|(k, v)| v.to_str().ok().map(|val| (k.to_string(), val.to_string())))
        .collect()
}