Package io.vertx.mutiny.ext.web.handler
Class CSPHandler
java.lang.Object
io.vertx.mutiny.ext.web.handler.CSPHandler
- All Implemented Interfaces:
MutinyDelegate
,io.vertx.core.Handler<RoutingContext>
,SecurityPolicyHandler
,Consumer<RoutingContext>
public class CSPHandler
extends Object
implements MutinyDelegate, SecurityPolicyHandler, 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 the
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCSPHandler
(io.vertx.ext.web.handler.CSPHandler delegate) CSPHandler
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(RoutingContext item) addDirective
(String name, String value) static CSPHandler
create()
boolean
io.vertx.ext.web.handler.CSPHandler
void
handle
(RoutingContext arg0) int
hashCode()
static CSPHandler
newInstance
(io.vertx.ext.web.handler.CSPHandler arg) setDirective
(String name, String value) setReportOnly
(boolean reportOnly) toString()
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
CSPHandler
public CSPHandler(io.vertx.ext.web.handler.CSPHandler delegate) -
CSPHandler
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.handler.CSPHandler getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Specified by:
getDelegate
in interfaceSecurityPolicyHandler
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
handle
- Specified by:
handle
in interfaceio.vertx.core.Handler<RoutingContext>
- Specified by:
handle
in interfaceSecurityPolicyHandler
-
create
- Returns:
- a new CSP handler.
-
setDirective
- Parameters:
name
- the directive namevalue
- the directive value.- Returns:
- fluent self
-
addDirective
- Parameters:
name
- the directive namevalue
- the directive value.- Returns:
- fluent self
-
setReportOnly
- Parameters:
reportOnly
- enable report only- Returns:
- fluent self.
-
accept
- Specified by:
accept
in interfaceConsumer<RoutingContext>
- Specified by:
accept
in interfaceSecurityPolicyHandler
-
newInstance
-