我在节点版本v8.9.4中遇到CORS问题。 错误是 -
Response to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://localhost:4200' is therefore not allowed
access.
在前端我正在使用angular4,并在我的标题中放置了代码,但仍面临问题。
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE,
OPTIONS');
header('Access-Control-Allow-Headers: Origin, Content-Type, X-Auth-
Token');
答案 0 :(得分:0)
不幸的是,这是Chrome错误/问题:https://bugs.chromium.org/p/chromium/issues/detail?id=67743
你必须要么