cors issue with Outlook Add-In

本小妞迷上赌 提交于 2019-12-12 09:18:40

问题


I am writing an Outlook Add-in and I am trying to make a fetch request to Jira. However, I am running into what I think is a CORS issue and I'm not sure how to get around it.

The error message says:

"[blocked] The page at https://localhost:3000/index.html?_host_Info=Outlook$Mac$16.02$en-US was not allowed to display insecure content from http://mysite.atlassian.net/rest/api/2/myself."

Is there any way to make a fetch request from an Outlook Add-in to get around CORS?

My add-in is just a react based front-end app and the fetch request requires basic authentication which works fine in postman (which of course is outside the browser but outlook add-ins run in a browser component).


回答1:


When making calls outside the domain your add-in is hosted in, you need to specify those domains in your add-in's manifest:

<AppDomains>
    <AppDomain>http://mysite.atlassian.net/</AppDomain>
    <AppDomain>https://mysite.atlassian.net/</AppDomain>
</AppDomains>


来源:https://stackoverflow.com/questions/50687805/cors-issue-with-outlook-add-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!