简体   繁体   English

如何修复 IE11 中缺少的请求头内容类型 | 角 8 应用程序

[英]How to fix request header content-type missing in IE11 | Angular 8 App

I am trying to update an Angular library to make it IE11 compliant.我正在尝试更新 Angular 库以使其符合 IE11。
The main problem that I'm facing is that all of the requests that the app makes to our backend fail in IE11.我面临的主要问题是应用程序向我们的后端发出的所有请求在 IE11 中都失败了。 For chrome/firefox this issue is not present.对于 chrome/firefox,此问题不存在。

Here is what I see in the IE dev tools:这是我在 IE 开发工具中看到的:

SEC7123: Request header content-type was not present in the Access-Control-Allow-Headers list.
SCRIPT7002: XMLHttpRequest: Network Error 0x80070005, Access is denied.
[object Object][object Object]
> message: "Http failure response for https://<redacted-url>/: 0 Unknown Error"

Is this a problem related to the server configuration or is there something I can change from the front-end?这是与服务器配置有关的问题还是我可以从前端更改?

Please let me know if there is something else I can add to help find the issue.请让我知道是否还有其他我可以添加的内容来帮助找到问题。

PS: Changing this internet explorer setting does solve the issue, but obviously it's not a viable solution PS: 更改此 Internet Explorer 设置确实解决了问题,但显然这不是一个可行的解决方案

Also, I should note that the backend and the front-end are NOT on the same domain .另外,我应该注意到后端和前端不在同一个域上 (And this can't be changed) (而且这是无法改变的)

Fixed with a server-side change.通过服务器端更改修复。 Apparently IE doesn't like the line:显然 IE 不喜欢这条线:

Access-Control-Allow-Headers: '*'

The headers must be explicited one by one.标头必须一一显式。

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

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