CORS request not working in Safari

后端 未结 13 1470
忘掉有多难
忘掉有多难 2020-11-27 06:04

I am making a CORS xhr request. This works fine in chrome, however when I run in safari I get an \'Can not load ---- access not allowed by Access-control-allow-origin\'.

13条回答
  •  眼角桃花
    2020-11-27 06:35

    When I query your URL I'm getting back the following Access-Control headers:

    Access-Control-Allow-Origin: *
    Access-Control-Expose-Headers: Authorization, Cache-Control, Content-Length, Date, Expires, Server, Transfer-Encoding, x-goog-meta-foo1
    

    I suspect it has something to do with your Access-Control headers - either you're leaving something out, or being too specific.

    Given that you're actually sending a custom header, you may want to try:

    Access-Control-Allow-Headers: *
    

    You could also see if leaving out Access-Control-Expose-Headers makes a difference.

    Beyond that, it would actually be helpful to see the actual request / response headers.

提交回复
热议问题