No 'Access-Control-Allow-Origin' header is present on the requested resource

Issue

You are seeing an error in the build console:

Access to XMLHttpRequest at "https://JENKINS_URL/SOME_REQUEST" from "http://JENKINS_URL/" 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.

Environment

Resolution

We can see from the error message that Jenkins is calling an HTTP endpoint from an HTTPS origin. The first question to ask yourself is whether this is expected. Is SSL implemented correctly? If not, please change the Jenkins URL in Manage Jenkins –> Configure Systems to HTTP until SSL is ready to use.

Workaround

Use the Cors Filter Plugin to include the additional origins.

References

Have more questions?

0 Comments

Please sign in to leave a comment.