I'm trying to follow AngularJS $http, CORS and http authentication to get filter results from JIRA and I can't make it work.
If I use the GET
method, the console reports:
XMLHttpRequest cannot load https://.../rest/api/2/search?jql=filter=28203. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Even though I've set useXDomain
.
If I use the JSONP
method, my success callback never gets invoked. I've tried .success
, .then
, and JSON_CALLBACK
and none work. While JSONP
isn't suppose to work at all in modern JIRA, I can see a successful response with the expected data in Chrome's Developer Tools' network work tab but the console reports:
Refused to execute script from 'https://.../rest/api/2/search?jql=filter=28203' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
My code -- based on that from the CORS question above -- is at https://plnkr.co/edit/IO4air3eN2vDoaOXJous?p=preview
What am I missing?