Cross-domain requests stopped working due to no `Access-Control-Allow-Origin` header present in the response

后端 未结 5 1440
迷失自我
迷失自我 2020-11-30 02:17

I have an error reporting beacon I created using Google Apps script and it is published to run as myself and to be accessible to "anyone, even anonymous," which

5条回答
  •  广开言路
    2020-11-30 02:30

    I stumbled upon the same issue:

    • calling /exec-urls from the browser went fine when running a webpage on localhost
    • throws crossorigin-error when called from a https-domain

    I was trying to avoid refactoring my POST JSON-clientcode into JSONP (I was skeptical, since things always worked before).

    Possible Fix #1

    Luckily, after I did one non-CORS request (fetch() in the browser from a https-domain, using mode: no-cors), the usual CORS-requests worked fine again.

    last thoughts

    A last explanation might be: every new appscript-deployment needs a bit of time/usage before its configuration actually settled down at server-level.

提交回复
热议问题