samedi 28 mars 2015

How to add CORS filter to Camel-Jetty Producer

I am trying to add CORS headers to a Camel Route with a Jetty Producer but cannot find a way to add init-parameters so I can set the 'allowedOrigins'. I am using Spring DSL to setup the Camel Context.



<bean id="corsFilter" class="org.eclipse.jetty.servlets.CrossOriginFilter/>

<camelContext id="domaincontext" xmlns="http://ift.tt/TZ5qsO" useMDCLogging="true" >
<route id="domain-proxy" streamCache="true">
<from uri="jetty:http://0.0.0.0:{{proxy.port}}/domain?matchOnUriPrefix=true&amp;filtersRef=#corsFilter"/>
<to uri="direct:routeWithSlip"/>
</route>
</camelContext>


I have tried to create a custom factory using the FilterHolder but the initialized filter config seems to be overwritten when the jetty component creates the endpoint.


How can I customize the configuration of the CrossOriginFilter from Spring/Blueprint?


Aucun commentaire:

Enregistrer un commentaire