Cannot activate parameter cors.config I am using the RESTful Web Services that is included in core of Drupal 8.2.7.
I need to activate CORS to be able to call the API from another domain.

I put this configuration in this file: "core/lib/Drupal/Core/core.services.yml" but it didn't work. I don't have the header Access-Control-Allow-Origin.

cors.config:
  enabled: true
  allowedHeaders: ['*']
  allowedMethods: ['*']
  allowedOrigins: ['*']
  exposedHeaders: true
  maxAge: true
  supportsCredentials: true


I found also this configuration is present in "sites/default/default.services.yml".

What is the proper way to configure CORS ?
To override container variables you have to enable this line in sites/default/settings.php (is enabled by default)

$settings['container_yamls'][] = __DIR__ . '/services.yml';


and then copy sites/default/default.services.yml to sites/default/services.yml.

Now you can configure the variables in services.yml.