1
0
mirror of https://github.com/actix/examples synced 2025-06-29 02:10:36 +02:00

Escape HTML (#366)

This commit is contained in:
mattn
2020-09-15 01:02:57 +09:00
committed by GitHub
parent 49e29a5751
commit e3c6a1ec07
3 changed files with 10 additions and 3 deletions

View File

@ -33,7 +33,14 @@ async fn main() -> io::Result<()> {
let app = move || {
debug!("Constructing the App");
let templates: Tera = Tera::new("templates/**/*").unwrap();
let mut templates = match Tera::new("templates/**/*") {
Ok(t) => t,
Err(e) => {
println!("Parsing error(s): {}", e);
::std::process::exit(1);
}
};
templates.autoescape_on(vec!["tera"]);
let session_store = CookieSession::signed(SESSION_SIGNING_KEY).secure(false);