structured-proxy 8.1.1

Universal gRPC→REST transcoding proxy — config-driven, works with any gRPC service
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::*;

#[test]
fn test_content_type_extraction() {
    let mut headers = HeaderMap::new();
    headers.insert(
        "content-type",
        "application/json; charset=utf-8".parse().unwrap(),
    );
    assert_eq!(content_type(&headers), Some("application/json"));
}

#[test]
fn test_content_type_missing() {
    let headers = HeaderMap::new();
    assert_eq!(content_type(&headers), None);
}