Currently, I have this config in my apache2.4 virtualhost:
Header always append Access-Control-Allow-Origin "https://www.testdomain.local"
Header always append Access-Control-Allow-Origin "https://testdomain.local"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"
RewriteEngine on
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]
However I keep getting this error:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.testdomain.local/ads?_=1572477483136. (Reason: CORS header ‘Access-Control-Allow-Origin’ does not match ‘https://www.testdomain.local, https://testdomain.local’).
I know i can fix this by setting the Access-Control-Allow-Origin to a wildcard but that is not secure.