Cors configuration issues when using ServiceStacks JsonServiceClient

喜你入骨 提交于 2019-12-11 07:58:26

问题


I have issues when trying to Post data to my API using ServiceStack's JsonServiceClient.

I get the following error message in the console

Access to fetch at 'https://192.168.10.191:5001/json/reply/CreateEquipment' from origin 'http://192.168.10.191:5000' has been blocked by CORS policy: Request header field headers is not allowed by Access-Control-Allow-Headers in preflight response.

I have added 192.168.10.191:5000 to the Whitelist.

I can see in the network tab that it tries to access "https://192.168.10.191:5001/json/reply/CreateEquipment" but nothing is showing when I capture the traffic using fiddler.

I have attached an image of the headers. https://i.stack.imgur.com/hUfII.png


回答1:


Your requesting a https resource at port 5001 but your origin white list returns a http resource on 5000, they need to match.



来源:https://stackoverflow.com/questions/55209512/cors-configuration-issues-when-using-servicestacks-jsonserviceclient

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