aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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))