cors-filter
cors-filter copied to clipboard
Potential enhancement: decouple filter configuration with web.xml init parameters
It will enable one scenario: changing CORS configuration without restarting the application server.
Sounds interesting, and I think it will be helpful for project in general. How do you propose to do it ?
Just grabbed the source. Very compact :). We could do it in two steps I guess.
First step is supporting the following configuration like the way https://bitbucket.org/thetransactioncompany/cors-filter/ does.
<init-param>
<param-name>cors.configurationFile</param-name>
<param-value>cors.properties</param-value>
</init-param>
By doing that, after starting up, our CORSFilter will have internal state configuraed by cors.properties.
The second step (I feel it's still under thought in my mind): If we could have a separated object to represent cors.properties, we just need a 'flush' mechanism we could call from some where else. (I am avoiding race conditions ... and performance :()