From cfb33b7f441e68161032b6505502b6490c4c0a3d Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Tue, 26 Jan 2021 16:17:01 +0100 Subject: move SputnikParts::csrf_token to CsrfToken::from_request --- examples/csrf/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/csrf/src/main.rs b/examples/csrf/src/main.rs index 7259abd..53ea87f 100644 --- a/examples/csrf/src/main.rs +++ b/examples/csrf/src/main.rs @@ -4,7 +4,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; @@ -38,7 +38,7 @@ fn get_form(req: &mut Parts) -> Response { .body( format!( "
{}
", - req.csrf_token().html_input() + CsrfToken::from_request(req).html_input() ).into() ).unwrap() } -- cgit v1.2.3