<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <parameters>
        <parameter key="nelmio_cors.cors_listener.class">Nelmio\CorsBundle\EventListener\CorsListener</parameter>
        <parameter key="nelmio_cors.options_resolver.class">Nelmio\CorsBundle\Options\Resolver</parameter>
        <parameter key="nelmio_cors.options_provider.config.class">Nelmio\CorsBundle\Options\ConfigProvider</parameter>
    </parameters>

    <services>
        <service id="nelmio_cors.cors_listener" class="%nelmio_cors.cors_listener.class%">
            <argument type="service" id="nelmio_cors.options_resolver" />
            <tag name="kernel.event_listener" event="kernel.request" method="onKernelRequest" priority="250" />
            <tag name="kernel.event_listener" event="kernel.response" method="onKernelResponse" priority="0" />
        </service>

        <service id="nelmio_cors.options_resolver" class="%nelmio_cors.options_resolver.class%" public="false" />

        <service id="nelmio_cors.options_provider.config" class="%nelmio_cors.options_provider.config.class%">
            <argument>%nelmio_cors.map%</argument>
            <argument>%nelmio_cors.defaults%</argument>
            <tag name="nelmio_cors.options_provider" priority="-1" />
        </service>

        <service id="nelmio_cors.cacheable_response_vary_listener" class="Nelmio\CorsBundle\EventListener\CacheableResponseVaryListener">
            <tag name="kernel.event_listener" event="kernel.response" method="onResponse" priority="-10" />
        </service>
    </services>
</container>
