So I've looked for answers here and I'm still running into this Preflight CORS error when including the header in my beforeSend attribute of my ajax call. This is to calling one of JIRA's API calls with jQuery. Desperately looking for a solution that works across all machines. What am I missing or not understanding about this CORS Policy blockage?
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
function getIssueTypes(s){
$.ajax({
url: domain+'rest/api/2/issuetype/project',
contentType:'application/json',
dataType:'json',
httpCompleteResponse:true,
type: 'GET',
data: {'projectId':s},
beforeSend: function( xhr ) {
xhr.setRequestHeader('Authorization',authenticateUser());
xhr.setRequestHeader('Access-Control-Allow-Methods','GET,POST,PUT,DELETE,OPTIONS');
xhr.setRequestHeader('Access-Control-Allow-Origin','*');
xhr.setRequestHeader('Access-Control-Allow-Headers','Content-Type');
xhr.setRequestHeader('Accept','*/*');
},
complete:function(data){
return data;
}
});
}