Package org.apache.wicket.csp
Class CSPRequestCycleListener
- java.lang.Object
-
- org.apache.wicket.csp.CSPRequestCycleListener
-
- All Implemented Interfaces:
IRequestCycleListener
public class CSPRequestCycleListener extends Object implements IRequestCycleListener
AnIRequestCycleListener
that addsContent-Security-Policy
and/orContent-Security-Policy-Report-Only
headers based on the supplied configuration.- Author:
- Sven Haster, Emond Papegaaij
-
-
Constructor Summary
Constructors Constructor Description CSPRequestCycleListener(ContentSecurityPolicySettings settings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
mustProtect(IRequestHandler handler)
Must the given handler be protected.void
onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
Called after anIRequestHandler
has been executed.void
onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
Called when anIRequestHandler
is resolved and will be executed.protected void
protect(RequestCycle cycle, IRequestHandler handler)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.request.cycle.IRequestCycleListener
onBeginRequest, onDetach, onEndRequest, onException, onExceptionRequestHandlerResolved, onRequestHandlerScheduled, onUrlMapped
-
-
-
-
Constructor Detail
-
CSPRequestCycleListener
public CSPRequestCycleListener(ContentSecurityPolicySettings settings)
-
-
Method Detail
-
onRequestHandlerResolved
public void onRequestHandlerResolved(RequestCycle cycle, IRequestHandler handler)
Description copied from interface:IRequestCycleListener
Called when anIRequestHandler
is resolved and will be executed.- Specified by:
onRequestHandlerResolved
in interfaceIRequestCycleListener
-
onRequestHandlerExecuted
public void onRequestHandlerExecuted(RequestCycle cycle, IRequestHandler handler)
Description copied from interface:IRequestCycleListener
Called after anIRequestHandler
has been executed. If the execution resulted in an exception this method will not be called for that particularIRequestHandler
.- Specified by:
onRequestHandlerExecuted
in interfaceIRequestCycleListener
-
protect
protected void protect(RequestCycle cycle, IRequestHandler handler)
-
mustProtect
protected boolean mustProtect(IRequestHandler handler)
Must the given handler be protected.- Parameters:
handler
- handler- Returns:
true
if must be protected- See Also:
ContentSecurityPolicySettings.mustProtectRequest(IRequestHandler)
-
-