Developers Forum for XinFin XDC Network

Discussion on: [WIP] CORS Issue on

rushabh_parmar profile image
Rushabh Parmar

On all the public RPC we have enabled --rpc --rpccorsdomain and Based on the provided information, Please note CORS headers are already set up on the server side for the public RPC at ''. The error message indicates that there is no 'Access-Control-Allow-Origin' header present on the response, which is essential for allowing cross-origin resource sharing.

If you've already configured the CORS headers on the server and are still facing issues, here are a few additional steps you can take to troubleshoot and resolve the CORS problem:

Verify CORS Headers Configuration:
Ensure that the server is configured to include the 'Access-Control-Allow-Origin' header in its responses. Check the server configuration, middleware, or application code to confirm that the appropriate CORS headers are being set. Additionally, ensure that the headers are not being overwritten or removed elsewhere in the application.

Check Preflight Requests:
The error message also mentions an issue with the preflight request. Preflight requests are HTTP options requests sent by the browser before the actual request. Ensure that the server responds correctly to preflight requests by allowing the necessary headers, methods, and origins.

Wildcard CORS Configuration (Not Recommended for Production):
As a temporary measure for testing, you can configure the server to allow all origins using a wildcard ('*') in the 'Access-Control-Allow-Origin' header. However, note that this is not recommended for production environments due to security concerns. It should only be used for testing purposes.

Logging and Debugging:
Enable detailed logging on the server side to capture CORS-related information. Check the server logs for any additional error messages or warnings related to CORS. Debugging tools in browsers can also provide insights into the CORS issues.

Update CORS Library or Middleware:
If you are using a CORS library or middleware in your server application, make sure it is up-to-date. Check for any updates or patches that might address CORS-related issues.

Network and Firewall Configuration:
Ensure that there are no network or firewall issues preventing communication between '' and ''. Confirm that the server is reachable and that there are no restrictions on cross-origin requests