diff options
author | Martin Fischer <martin@push-f.com> | 2021-01-25 22:38:06 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-01-25 22:50:40 +0100 |
commit | 3fd065757f02ebf1d055912e6809fac15c8bf058 (patch) | |
tree | f09e640f5c46111f5d63b68e5ec91bfbaee57541 /examples | |
parent | e04c832200f38ab49ce8e7a6d08ffc549b8a98e2 (diff) |
reintroduce CsrfToken typev0.3.3
Raw HTML is potentially dangerous so it's better to provide an
encapsulating type instead of relying on naked strings.
bump version to 0.3.3
Diffstat (limited to 'examples')
-rw-r--r-- | examples/csrf/src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/csrf/src/main.rs b/examples/csrf/src/main.rs index 94fd09c..1048689 100644 --- a/examples/csrf/src/main.rs +++ b/examples/csrf/src/main.rs @@ -34,7 +34,7 @@ async fn route(req: &mut Parts, body: Body) -> Result<Response, Error> { fn get_form(req: &mut Parts) -> Response { let mut response = Builder::new(); - let csrf_input = req.csrf_html_input(&mut response); + let csrf_input = req.csrf_token(&mut response).html_input(); response.content_type(mime::TEXT_HTML).body( format!("<form method=post> <input name=text>{}<button>Submit</button></form>", csrf_input).into() |