In my Outlook addin I have AJAX request with JQuery. Since few days the request is blocked with the following error :
Access to XMLHttpRequest at 'https://wordpress.com/woocommerce-api' from origin 'https://mywebsite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
CORS Policy seems ok server side. If i request the ressource with another client i have this response :
But when i request from Outlook client (web) i have this reponse :
So the issue probably come from my AJAX request. Check my code :
$.ajax({
url: "https://mywebsite.com/woocommerce/?wc-api=software-api&request=check&email=" + mailInput.val() + "&license_key=" + keyInput.val() + "&product_id=SMS+Outlook",
method: "GET",
xhrFields: {
withCredentials: true
},
crossDomain: true,
dataType: 'application/json'
})
I really don't understand why this issue appear only in Outlook side.