Closed kuceram closed 9 years ago
Added new configuration settings 'includeEnvironments' and 'excludeEnvironments'. Please see README for details.
Works nice, thanks!
:smile:
Good job
How is this work?
I wrote this in application.yml: corsInterceptor: includeEnvironments: ['development', 'test', 'production'] excludeEnvironments: ['production'] allowedOrigins: ['domain.com']
It seems that all origins can access even localhost. I would like to have only access to domain.com. Is it missing something? thanks in advance
@barcelona23 , your configuration looks good to me, except that you don't need to include "production" environment in both places.
corsInterceptor:
includeEnvironments: ['development', 'test']
excludeEnvironments: ['production']
allowedOrigins: ['domain.com']
And when you make requests to your Grails app, you'll need to make sure your requests contain Origin
header with value domain.com
to match your CORS interceptor setting.
Other than that it should just work. You can also check the test cases for clues.
It would be nice to have a configuration for switching CORS interceptor on and off. Than it would be easy to turn it on only for development.