public final class CspInterceptor extends AbstractInterceptor implements PreResultListener
CspSettings
to add appropriate Content Security Policy header
to the response. These headers determine what the browser will consider a policy violation and the browser's behavior
when a violation occurs. A detailed explanation of CSP can be found here.Constructor and Description |
---|
CspInterceptor() |
Modifier and Type | Method and Description |
---|---|
void |
beforeResult(ActionInvocation invocation,
String resultCode)
|
String |
intercept(ActionInvocation invocation)
Override to handle interception
|
void |
setEnforcingMode(String value) |
void |
setReportUri(String reportUri) |
destroy, init, setDisabled, shouldIntercept
public String intercept(ActionInvocation invocation) throws Exception
AbstractInterceptor
intercept
in interface Interceptor
intercept
in class AbstractInterceptor
invocation
- the action invocationActionInvocation.invoke()
, or from the interceptor itself.Exception
- any system-level error, as defined in Action.execute()
.public void beforeResult(ActionInvocation invocation, String resultCode)
PreResultListener
beforeResult
in interface PreResultListener
invocation
- the action invocationresultCode
- the result code returned by the action (eg. success
).public void setReportUri(String reportUri)
public void setEnforcingMode(String value)
Copyright © 2000–2023 Apache Software Foundation. All rights reserved.