Package io.vertx.mutiny.ext.web.handler
Class CSPHandler
- java.lang.Object
-
- io.vertx.mutiny.ext.web.handler.CSPHandler
-
- All Implemented Interfaces:
io.vertx.core.Handler<RoutingContext>,Consumer<RoutingContext>
public class CSPHandler extends Object implements io.vertx.core.Handler<RoutingContext>, Consumer<RoutingContext>
Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. These attacks are used for everything from data theft to site defacement to distribution of malware. CSP is designed to be fully backward compatible. Browsers that don't support it still work with servers that implement it, and vice-versa: browsers that don't support CSP simply ignore it, functioning as usual, defaulting to the standard same-origin policy for web content. If the site doesn't offer the CSP header, browsers likewise use the standard same-origin policy. NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<CSPHandler>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description CSPHandler(io.vertx.ext.web.handler.CSPHandler delegate)CSPHandler(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(RoutingContext item)CSPHandleraddDirective(String name, String value)static CSPHandlercreate()booleanequals(Object o)io.vertx.ext.web.handler.CSPHandlergetDelegate()voidhandle(RoutingContext arg0)inthashCode()static CSPHandlernewInstance(io.vertx.ext.web.handler.CSPHandler arg)CSPHandlersetDirective(String name, String value)CSPHandlersetReportOnly(boolean reportOnly)StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<CSPHandler> __TYPE_ARG
-
-
Constructor Detail
-
CSPHandler
public CSPHandler(io.vertx.ext.web.handler.CSPHandler delegate)
-
CSPHandler
public CSPHandler(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.handler.CSPHandler getDelegate()
-
handle
public void handle(RoutingContext arg0)
- Specified by:
handlein interfaceio.vertx.core.Handler<RoutingContext>
-
create
public static CSPHandler create()
- Returns:
- a new CSP handler.
-
setDirective
public CSPHandler setDirective(String name, String value)
- Parameters:
name- the directive namevalue- the directive value.- Returns:
- fluent self
-
addDirective
public CSPHandler addDirective(String name, String value)
- Parameters:
name- the directive namevalue- the directive value.- Returns:
- fluent self
-
setReportOnly
public CSPHandler setReportOnly(boolean reportOnly)
- Parameters:
reportOnly- enable report only- Returns:
- fluent self.
-
accept
public void accept(RoutingContext item)
- Specified by:
acceptin interfaceConsumer<RoutingContext>
-
newInstance
public static CSPHandler newInstance(io.vertx.ext.web.handler.CSPHandler arg)
-
-