@Override
    protected void doProcessFailure(PolicyFailure failure, IPolicyContext context, CorsConfigBean config,
            IPolicyFailureChain chain) {

        CaseInsensitiveStringMultiMap corsHeaders = getResponseHeaders(context);

        if(corsHeaders != EMPTY_MAP) {
            failure.getHeaders().putAll(corsHeaders.toMap());
        }

        chain.doFailure(failure);
    }
A policy implementing CORS (Cross-origin resource sharing): a method of defining access to resources
outside of the originating domain. It is principally a security mechanism to prevent the loading of
resources from unexpected domains, for instance via XSS injection attacks.

@see <a href="http://www.w3.org/TR/2014/REC-cors-20140116/">CORS W3C Recommendation 16 January 2014</a>
@see <a href="http://www.w3.org/wiki/CORS">CORS W3 Wiki</a>

@author Marc Savy {@literal <msavy@redhat.com>}
plugins/cors-policy/src/main/java/io/apiman/plugins/cors_policy/CorsPolicy.java