[RESOLVED] Setup CORS correctly

Your software
My Mautic version is: 3.1.2
My PHP version is: 7.2.3.4
My Database type and version is: MySQL (integrated in Bitnami stack)

Your problem
I am trying to send form data from my own app to a Mautic form. My own form is based on React, so I only want to send the data over. I was following this sample for this (which had been written for jQuery, but that doesn’t matter).

However, when I send the data over, I get a CORS error in the browser, because no Access-Control-Origin has been set. I have enabled CORS in the Mautic config, and also added some of my domains. However, if I try to send data with Postman, I can see that the Access-Control-Origin header is still empty, while all other CORS headers are set:

Is there anything special I have to setup to let Mautic answer with the correct Origin settings? I already send the X-Requested-With header with a value of XMLHttpRequest, before that no CORS headers were sent back. But maybe there’s another header I have to set?

Ok. It works if you add the domains with a protocol, like https.

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.