CORS Configuration Example
To change the settings for all origins or a specific origin, change the configuration to provide a set of “configurations”. By providing any configuration, the default “wide open” configuration is not configured.
micronaut:
server:
cors:
all:
...
...
...
In the above example, three configurations are being provided. Their names (all
, web
, mobile
) are not important and have no significance inside Micronaut. They are there purely to be able to easily recognize the intended user of the configuration.
When a CORS request is made, configurations are searched for allowed origins that are an exact match or match the request origin through a regular expression.