aboutsummaryrefslogtreecommitdiff
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
parent61efc35b0a9c62c18a7a98419bf2ddbc0a52a42d (diff)
fix code block highlighting in README on crates.iov0.1.1
-rw-r--r--Cargo.toml2
-rw-r--r--README.md6
2 files changed, 4 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 03f39a4..f469a0f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "sputnik"
-version = "0.1.0"
+version = "0.1.1"
authors = ["Martin Fischer <martin@push-f.com>"]
license = "MIT"
description = "A lightweight layer on top of hyper to facilitate building web applications."
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))