3 unstable releases

0.2.0 Dec 1, 2023
0.1.1 Jul 8, 2023
0.1.0 Jun 24, 2023

#18 in #hyperium

Download history 12/week @ 2024-11-08 5/week @ 2024-11-15 25/week @ 2024-12-06 11/week @ 2024-12-13 1/week @ 2025-01-31 63/week @ 2025-02-14

64 downloads per month
Used in yeet-yoink

MIT license

6KB
53 lines

Content-MD5 header support for hyperium/headers

This adds the RFC1864 Content-MD5 header as a typed header:

use headers::Header;
use http::HeaderValue;
use headers_content_md5::ContentMd5;

fn it_works() {
    let value = HeaderValue::from_static("Q2hlY2sgSW50ZWdyaXR5IQ==");
    let md5 = ContentMd5::decode(&mut [&value].into_iter()).unwrap();
    
    let expected = "Check Integrity!".as_bytes().try_into().unwrap();
    assert_eq!(md5, ContentMd5(expected))
}

lib.rs:

Provides the ContentMd5 typed header.

Example

use headers::Header;
use http::HeaderValue;
use headers_content_md5::ContentMd5;

let value = HeaderValue::from_static("Q2hlY2sgSW50ZWdyaXR5IQ==");
let md5 = ContentMd5::decode(&mut [&value].into_iter()).unwrap();
assert_eq!(md5.0, "Check Integrity!".as_bytes())

Dependencies

~2MB
~38K SLoC