-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome Access-Control-Allow-Origin header issue #3045
Comments
Nevermind! This is a configuration error on my part. For anyone else wondering, you have to make sure to have "restrict domains" turned off or have valid URLs defined in Mautic's configuration page under "CORS Settings." |
Thank you nickian! This was driving me crazy! |
Thank you nickian. |
thank :) |
I am also getting something similar error, i have already turned off in Mautic's configuration page under CORS Settings. but still getting below error. Access to XMLHttpRequest at 'https://mautic.onsitesoftware.com/mtc/event' from origin 'https://mydomain.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: The 'Access-Control-Allow-Origin' header contains multiple values 'https://mydomain.com, *', but only one is allowed. |
I'm not sure what else the problem could be. Maybe it is something with your server config. I would try what this article says: https://poanchen.github.io/blog/2016/11/20/how-to-enable-cross-origin-resource-sharing-on-an-apache-server |
@preetssekhon I think 'Access-Control-Allow-Origin' can have only ONE value - i.e. try with either '*' or 'https://mydomain.com'. This will be in your server configuration for Access-Control-Allow-Origin. |
There are no "CORS Settings" in the latest Mautic version anymore. I guess this has become the "API Credentials"... somehow this does not work for me and I still get this CORS headers warning in Firefox (latest). In Mautic's root .htaccess file I entered the following code:
I'm closed to a solution... the error of "missing CORS header" turned into
Anyone can help with the command "x-requested-with"? Which token do I have to use? |
SOLUTION FOUND:
Still I'm wondering how to wildcard specific variants of my domain to not have to note every single URI ... |
@Thurgood78 I'm not sure what version you are using, I'm using 3.1.1 and it exists: See more: https://about.lovia.life/docs/infrastructure/mautic-engineering/ |
I noticed that when I load the tracking script on a web site, I get this error in the console in Chrome and the anonymous contact doesn't appear to get logged in Mautic.
XMLHttpRequest cannot load https://mautic.mydomain.com/mtc. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://mydomain.com' is therefore not allowed access.
Is this a server configuration issue or a Mautic issue? The only alternative I can think of is to use the old image tracking pixel instead.
Thanks.
The text was updated successfully, but these errors were encountered: