Angular 角度2-铬和IE(11)CORS问题

Angular 角度2-铬和IE(11)CORS问题,angular,Angular,我正在运行angular 2应用程序(使用angular cli)并进行服务器API调用(在API代码中实现对所有(*)的CORS访问) 现在,当我尝试从angular 2应用程序进行API调用时,有时我从服务器得到的响应根本没有CORS问题,有时我得到以下问题: 对于Chrome浏览器: Failed to load resource: the server responded with a status of 500 (Internal Server Error) XMLHttpReque

我正在运行angular 2应用程序(使用angular cli)并进行服务器API调用(在API代码中实现对所有(*)的CORS访问)

现在,当我尝试从angular 2应用程序进行API调用时,有时我从服务器得到的响应根本没有CORS问题,有时我得到以下问题:

对于Chrome浏览器:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)

XMLHttpRequest cannot load https://server.com/api/currency.
No 'Access-Control-Allow-Origin' header is present on the requested resource. 
Origin 'http://localhost:4200' is therefore not allowed access. The response had HTTP status code 500.
适用于IE(11)浏览器

对于以上两种浏览器,响应标头都会返回

Response : HTTP/1.1 500 Interenal Server Error
Content-Length : 0
我还尝试清除浏览器缓存,但它没有按预期工作,我再次遇到上述问题

以上任何帮助都将不胜感激


谢谢

您的后端出现问题。您收到一条消息,服务器响应状态为500(内部服务器错误),这意味着发生了一些异常,这就是为什么没有为响应设置正确的头


查看apache日志,了解那里发生了什么。

在我看来,问题已经发生了很多次。我也面临着同样的问题。我使用的是OSX El Capitan 10.11.6,Chrome 58.0.3029.96。这个问题不会发生在Safari上。
Response : HTTP/1.1 500 Interenal Server Error
Content-Length : 0