public class XSS extends Object implements Jooby.Module
Lightweight set of escaping routines for fixing cross-site scripting (XSS) via coverity-security-library
{
use(new XSS());
post("/", req -> {
String safeHtml = req.param("text", "html").value();
});
}
Nested context are supported by providing multiple encoders:
{
use(new XSS());
post("/", req -> {
String safeHtml = req.param("text", "js", "html", "uri").value();
});
}
Encoders run in the order they are provided.
If you want to learn more about nested context and why they are important have a look at this nice guide from coverity-security-library.
| Constructor and Description |
|---|
XSS() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(Env env,
com.typesafe.config.Config conf,
com.google.inject.Binder binder) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconfigpublic void configure(Env env, com.typesafe.config.Config conf, com.google.inject.Binder binder)
configure in interface Jooby.ModuleCopyright © 2017. All rights reserved.