Support Article
CORS error when invoking Pega REST Service
SA-85966
Summary
Error occurs on invoking the Pega 7.3.1 REST Service from an AngularJS application on the localhost:4200 in the browser console.
Error Messages
Access to XMLHttpRequest at 'http://abcw:8080/prweb/api/v1/data/D_VertragsListe' from origin 'http://localhost:4200' 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.
Steps to Reproduce
- Create a data page in Pega 7.3.1 which is deployed on JBOSS 7 or Oracle.
- Create an Endpoint policy CORS exception.
- Invoke the API Serivce from the AngularJS application.
- Post to the endpoint.
Root Cause
A defect in Pegasystems’ code or rules.
The header was not set. CORS did not send the Access-Control-Allow-Origin header.
Resolution
Apply HFix-42650 and restart the server.
Published October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.