我已经在自己的自定义域中将Web应用托管在“ Firebase托管”上,例如:- webapp.example.com 。我启用了CORS,以便浏览器不会阻止它。
我的REST服务托管在另一个子域中,例如:- api.example.com
现在,当我从Web应用程序调用API时,它说“无法加载响应”并失败。
状态代码为200。
响应标题:
Access-Control-Allow-Headers: Origin,X-Requested-With,Content-Type,Accept
Access-Control-Allow-Methods: POST,GET,PUT,OPTIONS,DELETE,PATCH
Access-Control-Allow-Origin: *
Access-Control-Max-Age: 3600
Allow: GET, HEAD, POST, TRACE, OPTIONS
Connection: close
Content-Length: 0
Date: Sun, 28 Apr 2019 09:37:30 GMT
Server: Apache-Coyote/1.1
请求标头
Access-Control-Request-Headers: content-type,x-referral
Access-Control-Request-Method: GET
Origin: https://webapp.example.com
Referer: https://webapp.example.com/
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
任何想法为什么会发生这种情况或我应该如何解决。