Код: Выделить всё
Access to XMLHttpRequest at 'My Server URL' from origin 'Server Name' has been
blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple
values 'Server Name, *', but only one is allowed.
Код: Выделить всё
var cors = new EnableCorsAttribute("MyServerName", "Content-Type", "GET,PUT,POST,DELETE");
config.EnableCors(cors);
ОБНОВЛЕНИЕ:
При отключении определения CORS в файле WebApiConfig.cs я получаю сообщение следующая ошибка при выполнении запроса:
Код: Выделить всё
Access to XMLHttpRequest at 'My Server URL' from origin 'Server Name' 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.
ОБНОВЛЕНИЕ 2
Мое значение Access-Control-Allow-Origin было определено в моем IIS, после его изменения и запуска он думает, что это значение равно ''.
Подробнее здесь: https://stackoverflow.com/questions/596 ... ever-i-onl
Мобильная версия