I developed an Excel Add-in using JavaScript API (office.js). Then, I'm using an Asp.Net MVC at the server-side. This works fine on excel desktop, but custom functions don't work in Excel on the web. When I inspect the task pane it shows these errors:
Access to XMLHttpRequest at 'https://www.xxxxxx.com.br/dist/functions.json' from origin 'https://excel.officeapps.live.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Failed to load resource: net::ERR_FAILED https://www.xxxxxx.com.br/dist/functions.json
In Excel on the Web, the task pane and the commands work fine. The CORS problem in functions.json is strange because this archive belongs to the dist folder.
I saw this document and modified the HTTP response headers but it doesn't work.
OBS: Everything is hosted at the same domain
Can you give me some direction?