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 /README.md | |
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 'README.md')
-rw-r--r-- | README.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -59,7 +59,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() |