I have two sites. On the first, I created a REST export page with information I need on the second one. I got this working for some years, but since my last update to Drupal 9.4.4 and from PHP 7 to PHP 8, it doesn't anymore.
The full error message is the following.
Access to XMLHttpRequest at 'https://site1.com/json/site1-agenda?today=08042022&_format=json' from origin 'https://site2.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
On the first site, I have the following CORS information in services.yml.
enabled: true
# Specify allowed headers, like 'x-allowed-header'.
allowedHeaders: ['*']
# Specify allowed request methods, specify ['*'] to allow all possible ones.
allowedMethods: ['GET']
# Configure requests allowed from specific origins.
allowedOrigins: ['https://site2.com']
# Sets the Access-Control-Expose-Headers header.
exposedHeaders: true
# Sets the Access-Control-Max-Age header.
maxAge: true
# Sets the Access-Control-Allow-Credentials header.
supportsCredentials: true
Is there anything wrong with my setup? Or a way to debug this?