我们已经将micronaut服务(带有gradle)部署到AWS Beanstalk中,并通过Angular Application进行使用。在chrome浏览器中一切正常,但是当我们使用IE运行应用程序时,看到以下错误:
- 在access-Control-Allow-Headers列表中不存在请求标头缓存控制。
- XMLHttpRequest:网络错误0x80070005,访问被拒绝。
我确定我们已在appliaction.yml中启用了CORS
有人可以帮我吗
micronaut:
application:
name: testing-api
server:
port: 4543
cors:
enabled: true
服务应该在所有浏览器中得到响应
我的服务请求标头信息如下所示。
Request URL: http://testurl.com/controller/method/stringParam
Request Method: OPTIONS
Status Code: 200 / OK
- Request Headers
accept: */*
accept-Encoding: gzip,deflate
access-Control-Request-Headers: content-type,cache-control,expires,pragma,access-control-allow-headers,accept
access-Control-Request-Method: GET
Cache-Control: no-cache
Connection: Keep-Alive
Content-Length: 0
Host: testurl.com
Origin: http://localhost:4200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko
- Response Headers
access-Control-Allow-Credentials: true
access-Control-Allow-Headers: content-type,accept
access-Control-Allow-Methods: GET
access-control-allow-origin: http://localhost:4200
access-Control-Max-Age: 1800
Connection: keep-alive
Date: Tue,05 Nov 2019 05:23:24 GMT
Server: nginx/1.14.1
Transfer-Encoding: chunked
Vary: Origin