https://github.com/sunsided/hyperium-headers-content-md5
typed Content-MD5 header
https://github.com/sunsided/hyperium-headers-content-md5
headers http hyperium rust
Last synced: 9 months ago
JSON representation
typed Content-MD5 header
- Host: GitHub
- URL: https://github.com/sunsided/hyperium-headers-content-md5
- Owner: sunsided
- License: mit
- Created: 2023-06-24T19:52:52.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-26T11:21:45.000Z (about 2 years ago)
- Last Synced: 2024-04-26T19:49:13.648Z (almost 2 years ago)
- Topics: headers, http, hyperium, rust
- Language: Rust
- Homepage: https://crates.io/crates/headers-content-md5
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Content-MD5 header support for hyperium/headers
This adds the [RFC1864](https://datatracker.ietf.org/doc/html/rfc1864) `Content-MD5` header as a typed header:
```rust
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))
}
```