aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-01-26 16:17:01 +0100
committerMartin Fischer <martin@push-f.com>2021-01-26 16:20:14 +0100
commitcfb33b7f441e68161032b6505502b6490c4c0a3d (patch)
treec9b66b419b039ccaff1ff0ff3b49859a4d07c25c /README.md
parent4502efc51474cdb7ffd0d77402f62aed8badf7bf (diff)
move SputnikParts::csrf_token to CsrfToken::from_request
Diffstat (limited to 'README.md')
-rw-r--r--README.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/README.md b/README.md
index 2932d70..a3c0a71 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ use hyper::{Method, Server, StatusCode, Body};
use hyper::http::request::Parts;
use hyper::http::response::Builder;
use serde::Deserialize;
-use sputnik::{mime, request::{SputnikParts, SputnikBody}, response::SputnikBuilder};
+use sputnik::{mime, request::{SputnikParts, SputnikBody, CsrfToken}, response::SputnikBuilder};
use sputnik::request::CsrfProtectedFormError;
type Response = hyper::Response<Body>;
@@ -63,7 +63,7 @@ fn get_form(req: &mut Parts) -> Response {
.body(
format!(
"<form method=post><input name=text>{}<button>Submit</button></form>",
- req.csrf_token().html_input()
+ CsrfToken::from_request(req).html_input()
).into()
).unwrap()
}