zino-core 0.43.1

Core types and traits for zino.
Documentation
1
2
3
4
5
6
7
8
9
10
/// Checks whether it has a `content-type: application/json` or similar header.
pub(crate) fn check_json_content_type(content_type: &str) -> bool {
    let essence = if let Some((essence, _)) = content_type.split_once(';') {
        essence
    } else {
        content_type
    };
    essence == "application/json"
        || (essence.starts_with("application/") && essence.ends_with("+json"))
}