При создании запроса выдается следующее сообщение об ошибке:
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.
Однако в моем файле WebApiConfig.cs я определил политику CORS следующим образом:
var cors = new EnableCorsAttribute("MyServerName", "Content-Type", "GET,PUT,POST,DELETE");
config.EnableCors(cors);
У меня есть определено только одно значение MyServerName , однако выброшенная ошибка определяет его как 'Server Name, *'
ОБНОВЛЕНИЕ:
При отключении моего определения 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.
В моем файле Web.config не определено CORS.
ОБНОВЛЕНИЕ 2
Мое значение Access-Control-Allow-Origin определялось в моем IIS, после изменения и запуска оно думает, что это значение ''.