Fork me on GitHub
Edit on GitHub << back to Interceptors

Cross-Origin Embedder Policy Interceptor

Description

Interceptor that implements Cross-Origin Embedder Policy on incoming requests.

COEP prevents the document from loading any framed documents which don’t opt-in by setting the COEP header:

Cross-Origin-Embedder-Policy: require-corp

This provides protection for documents that don’t restrict framing. A document that doesn’t set COEP cannot be framed by another document with COEP. All descendents of a document with COEP will also enforce the same restrictions.

COEP is now supported by all major browsers. More information about COEP.

Parameters

Before Struts 7.5.0 and 6.13.0 exemptedPaths was compared with the context path of the application, so an entry naming a request path had no effect and an entry equal to the context path disabled the interceptor for the whole application. Use disabled if you relied on the latter.

Examples

<package name="default" extends="struts-default">
    <interceptors>
        <interceptor-stack name="appDefaultStack">
            <interceptor-ref name="defaultStack">
                <param name="coep.exemptedPaths">/embed/widget.action</param>
                <param name="coep.enforcingMode">false</param>
            </interceptor-ref>
        </interceptor-stack>
    </interceptors>
    <default-interceptor-ref name="appDefaultStack"/>
</package>
Follow @x