Use handlebars so that message is escaped in cookies example.

This commit is contained in:
Sergio Benitez 2016-11-04 15:33:58 +01:00
parent 4d189df884
commit d843e8354c
3 changed files with 6 additions and 7 deletions

View File

@ -12,4 +12,4 @@ lazy_static = "*"
[dependencies.rocket_contrib] [dependencies.rocket_contrib]
path = "../../contrib" path = "../../contrib"
default-features = false default-features = false
features = ["tera_templates"] features = ["handlebars_templates"]

View File

@ -1,8 +1,7 @@
#![feature(plugin, custom_derive, custom_attribute)] #![feature(plugin, custom_derive, custom_attribute)]
#![plugin(rocket_codegen)] #![plugin(rocket_codegen)]
#[macro_use] #[macro_use] extern crate lazy_static;
extern crate lazy_static;
extern crate rocket_contrib; extern crate rocket_contrib;
extern crate rocket; extern crate rocket;

View File

@ -7,11 +7,11 @@
</head> </head>
<body> <body>
<h1>Rocket Cookie Examples</h1> <h1>Rocket Cookie Examples</h1>
{% if message is defined %} {{#if message }}
<p>{{message}}</p> <p>{{message}}</p>
{% else %} {{else}}
<p>No message yet.</p> <p>No message yet.</p>
{% endif %} {{/if}}
<form action="/submit" method="post" accept-charset="utf-8"> <form action="/submit" method="post" accept-charset="utf-8">
<textarea placeholder="Your message here..." <textarea placeholder="Your message here..."