Module org.apache.wicket.core
Package org.apache.wicket.coep
Class CrossOriginEmbedderPolicyRequestCycleListener
java.lang.Object
org.apache.wicket.coep.CrossOriginEmbedderPolicyRequestCycleListener
- All Implemented Interfaces:
IRequestCycleListener
public class CrossOriginEmbedderPolicyRequestCycleListener
extends Object
implements IRequestCycleListener
Sets Cross-Origin Embedder
Policy (COEP) headers on the responses based on the mode specified by
CrossOriginEmbedderPolicyConfiguration
. COEP can be enabled in REPORTING
mode which will set the headers as Cross-Origin-Embedder-Policy-Report-Only
or
ENFORCING
mode which will set the header as
Cross-Origin-Embedder-Policy
. The header is not set for the paths that are exempted
from COEP. The only valid value of COEP is require-corp
, so if the listener is
enabled the policy value will be specified as so.
COEP prevents a document from loading any non-same-origin resources which don't explicitly grant
the document permission to be loaded. Using COEP and COOP together allows developers to safely
use powerful features such as SharedArrayBuffer
,
performance.measureMemory()
, and the JS Self-Profiling API.See
CrossOriginOpenerPolicyRequestCycleListener
for instructions on how to enable COOP.
Read more about cross-origin isolation on
https://web.dev/why-coop-coep/
- Author:
- Santiago Diaz - saldiaz@google.com, Ecenaz Jen Ozmen - ecenazo@google.com
- See Also:
-
Constructor Summary
ConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
CrossOriginEmbedderPolicyRequestCycleListener
-
-
Method Details
-
onRequestHandlerResolved
Description copied from interface:IRequestCycleListener
Called when anIRequestHandler
is resolved and will be executed.- Specified by:
onRequestHandlerResolved
in interfaceIRequestCycleListener
-
onRequestHandlerExecuted
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
-