aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-01-17 20:12:12 +0100
committerMartin Fischer <martin@push-f.com>2021-01-17 20:13:51 +0100
commitc27c5b3109e2b4fd8cdbe312f4925edc238a25e9 (patch)
treedb3bb86b90409e8751823a9669630d0a217f0c16 /README.md
parent61efc35b0a9c62c18a7a98419bf2ddbc0a52a42d (diff)
fix code block highlighting in README on crates.iov0.1.1
Diffstat (limited to 'README.md')
-rw-r--r--README.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/README.md b/README.md
index 3b2877e..ec67b2e 100644
--- a/README.md
+++ b/README.md
@@ -26,7 +26,7 @@ Sputnik does **not**:
## CsrfToken example
-```rs
+```rust
use std::convert::Infallible;
use hyper::service::{service_fn, make_service_fn};
use hyper::{Method, Server};
@@ -92,7 +92,7 @@ async fn main() {
After a successful authentication you can build a session id cookie for
example as follows:
-```rs
+```rust
let expiry_date = OffsetDateTime::now_utc() + Duration::hours(24);
let mut cookie = Cookie::new("userid",
key.sign(
@@ -106,7 +106,7 @@ resp.set_cookie(cookie);
This session id cookie can then be retrieved and verified as follows:
-```rs
+```rust
let userid = req.cookies().get("userid")
.ok_or_else(|| Error::unauthorized("expected userid cookie".to_owned()))
.and_then(|cookie| key.verify(cookie.value()).map_err(Error::unauthorized))