CORS request not working in Safari

后端 未结 13 1520
忘掉有多难
忘掉有多难 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:47

    try to remove overide mimetype.

     var
     jsonhandler=function(){var req=JSON.parse(this.response);console.log(req)},
     req=new XMLHttpRequest;
     req.open('GET','https://storage.googleapis.com/fflog/135172watersupplies_json');
     req.setRequestHeader('Authorization','Bearer '+accessToken);
     req.onload=jsonhandler;
     req.send();
    

提交回复
热议问题