Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Digest Headers
A library to aid in the creation and verification of Digest Headers, Sha Digests of HTTP Request Bodies
Getting started
Add the following to your Cargo.toml
[]
= false
If you want the hyper types, add features = ["use_hyper"]
to the digest-headers
section. If you
want the rocket types, add features = ["use_rocket"]
.
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 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 Rocket and Hyper servers run on the same port, so you can't run them simultaneously
- The Hyper Client example is configured to send POST requests to the Rocket and Hyper Server examples.
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/.