Digest Headers
A library to aid in the creation and verification of Digest Headers, Sha Digests of HTTP Request Bodies
Getting started
Building requests with Hyper
use Digest;
use DigestHeader;
let mut req = new;
req.headers_mut.set;
req.headers_mut.set;
req.headers_mut.set;
req.set_body;
Handling requests with Hyper
use Digest;
use DigestHeader;
let digest_header = req.headers_mut..unwrap.0;
req.body.concat2.and_then
Handling requests with Hyper
use DigestHeader;
use ;
use ;
;
Handling requests with Rocket
use DigestHeader;
use ;
;
What this library supports
- Creation of Digest Header strings
- Verification of Digest Header strings
- Adding Digest Headers to Hyper Requests (with the
use_hyper
feature). - Digest and Content Length Header request guards for Rocket (with the
use_rocket
feature).
Examples
- Hyper Client example, very short and sweet
- Rocket Server Example. This one is more in-depth. It implements
rocket::request::FromRequest
for two custom structs for theDigest
andContentLength
headers, and implementsFromData
for a simple wrapper around aVec<u8>
. See the example for the full implementation.
Notes
- The Hyper Client example is configured to send POST request to the Rocket Server example.
- When running the examples, remember to pass the
--all-features
flag tocargo run
Contributing
Please be aware that all code contributed to this project will be licensed under the GPL version 3.
License
Digest Headers is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Digest Headers is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. This file is part of Digest Headers
You should have received a copy of the GNU General Public License along with Digest Headers If not, see http://www.gnu.org/licenses/.