detect_request_compression_preference

Function detect_request_compression_preference 

Source
pub fn detect_request_compression_preference(
    headers: &HeaderMap,
) -> Option<ContentEncoding>
Expand description

Detect the most efficient request compression supported by the server.

This inspects the server’s Accept-Encoding response header and applies quality factors (q= weights) to pick the optimal ContentEncoding supported by both parties. Returns None when the header is absent or when no mutually supported encoding is advertised.