简体   繁体   English

WSO2 API 管理器 - CORS

[英]WSO2 API Manager - CORS

I'm trying to call an API through WSO2 API Manager but getting CORS error (browser console):我正在尝试通过 WSO2 API 管理器调用 API,但收到 CORS 错误(浏览器控制台):

Access to XMLHttpRequest at 'https://localhost:8243/blk/mantem-instituicoes/' from origin 'http://localhost:4200' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.

Followed this document from official docs but it doesn't work.按照官方文档中的此文档进行操作,但它不起作用。

How do I configure CORS correctly in order to call APIs from my application?如何正确配置 CORS 以便从我的应用程序调用 API?

Thanks in advance,提前致谢,

Ok, I found how to set allowed origins:好的,我找到了如何设置允许的来源:

  1. If you uncheck "Allow All Origins" you can set the list of allowed hosts.如果取消选中“允许所有来源”,则可以设置允许的主机列表。

It's confuse because input appears only when you uncheck this option.这很混乱,因为只有当您取消选中此选项时才会出现输入。 See below:见下文:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM