I want to call the API REST Confluence for my confluence server in Sharepoint's React.js code.
But I have this issue:
Access to XMLHttpRequest at 'http://confluence-server' from origin 'http://sharepoint2019' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I already add http://sharepoint2019 in the whiteliste of my confluence server.
Thanks in advance
Thank you for reporting this to us. I'm aware of a bug where adding the URL to Allow Incoming in the Confluence whitelist isn't adding the necessary header.
There's a workaround on that bug where you can add the header yourself:
<!-- Tomcat built in CORS implementation --> <filter> <filter-name>CorsFilter</filter-name> <filter-class>org.apache.catalina.filters.CorsFilter</filter-class> </filter> <filter-mapping> <filter-name>CorsFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- End of built in CORS implementation -->
Header set Access-Control-Allow-Origin "*"
Can you try that, and let me know how it goes?
It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events