The developer has included the Web-to-Lead form I have provided in his React - js application. I have enabled the CORS in Salesforce, but the developer is receiving the below error message, when they are trying to submit a Lead:
Failed to load resource: the server responded with a status of 404 (Not Found)
Access to HMLHttpRequest at <Salesforce URL> from origin <http://ipaddress>" has been blocked by CORS policy: No "Access-Control-Allow-Origin" header is present on the requested resource.
Unfortunately, looking at the origin in the error message, I have realised I have been given the URL that appears in the browser's address bar to add it on the allowlist, rather than the origin URL as I have asked for.
I have asked for the origin the request header again and having a look in the Request Headers section and it looks like the "Referer" is a localhost: http://localhost:..../
I have used this link as a guidance - https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/extend_code_cors.htm , but am I meant to add both the IP address and the localhost in the CORS?
Any help is much appreciated. Thank you.