cors-filter icon indicating copy to clipboard operation
cors-filter copied to clipboard

Potential enhancement: decouple filter configuration with web.xml init parameters

Open MagIciaNGTAO opened this issue 11 years ago • 2 comments

It will enable one scenario: changing CORS configuration without restarting the application server.

MagIciaNGTAO avatar Aug 10 '14 20:08 MagIciaNGTAO

Sounds interesting, and I think it will be helpful for project in general. How do you propose to do it ?

mohitsoni avatar Aug 10 '14 22:08 mohitsoni

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 :()

MagIciaNGTAO avatar Aug 11 '14 00:08 MagIciaNGTAO